From 5a18e1b71d0231406d19ca355514648e4e0195b5 Mon Sep 17 00:00:00 2001 From: vesaber Date: Fri, 13 Mar 2026 00:51:56 +0100 Subject: [PATCH] feat: Improved connection logs, genuinely have no idea why it sometimes fails --- index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index ddf093e..052ba72 100644 --- a/index.ts +++ b/index.ts @@ -10,7 +10,12 @@ const client = new Client({ }, }); -client.on(Events.Ready, () => console.log("Ready!")); +client.on(Events.Error, (err) => console.error("[Error]", err)); +client.on(Events.Ready, () => { + console.log(`Ready! Logged in as ${client.user?.username} (${client.user?.id})`); + console.log(`Guilds: ${client.guilds.size}`); + console.log(`REST API: ${(client.rest as any).options?.api ?? "default"}`); +}); client.on(Events.MessageCreate, async (message) => { CommandHandler(message); @@ -32,9 +37,9 @@ client.on(Events.MessageCreate, async (message) => { }); await initDatabase(); +console.log("Database ready. Connecting..."); await client.login(process.env.FLUXER_BOT_TOKEN!); +console.log("Login call returned."); // Shoutout max for the headstart - -// TODO: Better "Ready!" output // TODO: Roadmap \ No newline at end of file