From 7ca2e741515851c22e302cb22905adac95c5bc29 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sun, 9 Nov 2025 22:16:13 +0000 Subject: [PATCH] completionId: cgen-1d70769f8a0d488d921283e8f049547d cgen-1d70769f8a0d488d921283e8f049547d --- discord-bot/bot.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/discord-bot/bot.js b/discord-bot/bot.js index de493833..b910bf01 100644 --- a/discord-bot/bot.js +++ b/discord-bot/bot.js @@ -33,6 +33,16 @@ if (missingVars.length > 0) { process.exit(1); } +// Validate token format +const token = process.env.DISCORD_BOT_TOKEN; +if (!token || token.length < 20) { + console.error("❌ FATAL ERROR: DISCORD_BOT_TOKEN is empty or invalid"); + console.error(` Length: ${token ? token.length : 0}`); + process.exit(1); +} + +console.log("[Token] Bot token loaded (length: " + token.length + " chars)"); + // Initialize Discord client const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.DirectMessages],