From a73bf279b0e2208a05479c7d760d15a8fc93aad6 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 8 Nov 2025 22:11:33 +0000 Subject: [PATCH] completionId: cgen-8af31085c24647f5b9fd491559cd1817 cgen-8af31085c24647f5b9fd491559cd1817 --- server/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/index.ts b/server/index.ts index f1b61154..26001628 100644 --- a/server/index.ts +++ b/server/index.ts @@ -922,6 +922,19 @@ export function createServer() { }); } + // Validate token format + if (!botToken.includes(".") || botToken.length < 50) { + console.warn( + "[Discord] Bot token appears invalid - length:", + botToken.length, + ); + return res.status(500).json({ + error: + "Discord bot token appears invalid (check DISCORD_BOT_TOKEN in environment)", + tokenLength: botToken.length, + }); + } + // Register slash commands const commands = [ {