edit logging formats

This commit is contained in:
Lio Young 2021-04-21 02:28:07 +02:00
parent 7dcbc26975
commit d4ed670821
No known key found for this signature in database
GPG Key ID: 789795A11879E169
3 changed files with 15 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import config from "../../config";
import { Commands, Shortlink, SourceFinder } from "../utils/wrapper.features";
import lingua from "../utils/lingua";
import replace from "../utils/replace";
import chalk from "chalk";
export = {
name: "message",
@ -121,9 +122,9 @@ export = {
let { data: command_usage_data, command_usage_error } = await supabase.from<Usage>('usage').update({ amount: (usage_check_data[0] || { amount: 0 }).amount + 1 }).select().eq("name", cmd.name)
Logger.info({
type: "event:command",
type: "command:executed",
command: cmd.name,
message: args.join(' ') || `${cmd.name} was executed`
message: args.join(' ') || `${cmd.name} was executed in ${chalk.red('[')}${ctx.guild.name}${chalk.red(']')}(${ctx.guild?.id})`
})
} catch (error) {
// Logger.error(error)

View File

@ -1,9 +1,14 @@
import Logger from "../utils/logger"
import config from "../../config"
export = {
name: "ready",
// @ts-ignore
run: async (client: any) => {
console.log(`${config.variables.name} has started.`)
Logger.info({
type: "event:ready",
message: `${config.variables.name} has started`
})
}
}

View File

@ -1,6 +1,7 @@
import { Client, Collection } from "discord.js";
import { readdirSync as read } from "fs";
import path from "path";
import Logger from "../../utils/logger";
// const server = require('../../website/server');
export default class Thaldrin extends Client {
@ -51,6 +52,11 @@ export default class Thaldrin extends Client {
const file = require(path.join(__dirname, '../../modules', module, command));
const Command = new file();
Command.module = module
Logger.info({
type: "command:loaded",
command: Command.name,
message: `${Command.name} was loaded`
})
this.commands.set(Command.name, Command);
} catch (err) {
console.error(err);