mirror of https://github.com/thaldrin/thaldrin.git
edit logging formats
This commit is contained in:
parent
7dcbc26975
commit
d4ed670821
|
@ -7,6 +7,7 @@ import config from "../../config";
|
||||||
import { Commands, Shortlink, SourceFinder } from "../utils/wrapper.features";
|
import { Commands, Shortlink, SourceFinder } from "../utils/wrapper.features";
|
||||||
import lingua from "../utils/lingua";
|
import lingua from "../utils/lingua";
|
||||||
import replace from "../utils/replace";
|
import replace from "../utils/replace";
|
||||||
|
import chalk from "chalk";
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "message",
|
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)
|
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({
|
Logger.info({
|
||||||
type: "event:command",
|
type: "command:executed",
|
||||||
command: cmd.name,
|
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) {
|
} catch (error) {
|
||||||
// Logger.error(error)
|
// Logger.error(error)
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
|
import Logger from "../utils/logger"
|
||||||
import config from "../../config"
|
import config from "../../config"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "ready",
|
name: "ready",
|
||||||
|
// @ts-ignore
|
||||||
run: async (client: any) => {
|
run: async (client: any) => {
|
||||||
console.log(`${config.variables.name} has started.`)
|
Logger.info({
|
||||||
|
type: "event:ready",
|
||||||
|
message: `${config.variables.name} has started`
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
import { Client, Collection } from "discord.js";
|
import { Client, Collection } from "discord.js";
|
||||||
import { readdirSync as read } from "fs";
|
import { readdirSync as read } from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import Logger from "../../utils/logger";
|
||||||
// const server = require('../../website/server');
|
// const server = require('../../website/server');
|
||||||
|
|
||||||
export default class Thaldrin extends Client {
|
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 file = require(path.join(__dirname, '../../modules', module, command));
|
||||||
const Command = new file();
|
const Command = new file();
|
||||||
Command.module = module
|
Command.module = module
|
||||||
|
Logger.info({
|
||||||
|
type: "command:loaded",
|
||||||
|
command: Command.name,
|
||||||
|
message: `${Command.name} was loaded`
|
||||||
|
})
|
||||||
this.commands.set(Command.name, Command);
|
this.commands.set(Command.name, Command);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
Loading…
Reference in New Issue