diff --git a/src/events/message.ts b/src/events/message.ts index 3b3200b..e9da3ce 100644 --- a/src/events/message.ts +++ b/src/events/message.ts @@ -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').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) diff --git a/src/events/ready.ts b/src/events/ready.ts index 0665a34..4c4f4cb 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -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` + }) } } \ No newline at end of file diff --git a/src/handler/client/Client.ts b/src/handler/client/Client.ts index 4730bd2..aeeb4bf 100755 --- a/src/handler/client/Client.ts +++ b/src/handler/client/Client.ts @@ -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);