From 99200b438a4ea2bff7df68d56487a6ada784a40e Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 8 Aug 2023 00:42:32 +1000 Subject: [PATCH] Add debug logging --- src/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 930ac2f..4a0cd46 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,5 +1,5 @@ import Discord, {Client, WebhookClient, GatewayIntentBits, Partials} from 'discord.js'; -import {readFileSync, readdirSync} from 'node:fs'; +import {readFileSync, readdirSync, promises} from 'node:fs'; import {exec} from 'node:child_process'; import mongoose from 'mongoose'; import {formatTimeOpt, Tokens, Config, repeatedMessages, MPServerCache} from './typings/interfaces'; @@ -105,10 +105,12 @@ export default class TClient extends Client { }).then(()=>console.log(this.logTime(), 'Successfully connected to MongoDB')).catch(err=>{console.error(this.logTime(), `Failed to connect to MongoDB\n${err}`); exec('pm2 stop Daggerbot')}) this.login(this.tokens.main); for await (const file of readdirSync('dist/events')){ + //console.log('EVENTS:', file) const eventFile = await import(`./events/${file}`); this.on(file.replace('.js',''), async(...args)=>eventFile.default.run(this,...args)) } for await (const file of readdirSync('dist/commands')){ + //console.log('COMMANDS:', file) const command = await import(`./commands/${file}`); this.commands.set(command.default.data.name,{command, uses: 0}); this.registry.push(command.default.data.toJSON())