From e58f43ffaac23140f1cab11e87cd689eeed303cc Mon Sep 17 00:00:00 2001 From: ITOH Date: Sat, 13 Nov 2021 15:31:52 +0100 Subject: [PATCH] get bot id from token --- tests/mod.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/mod.ts b/tests/mod.ts index d416192f9..9e051d651 100644 --- a/tests/mod.ts +++ b/tests/mod.ts @@ -73,12 +73,19 @@ const sanitizeMode = { Deno.test({ name: "[Bot] - Starting Tests", fn: async (t) => { + const token = Deno.env.get("DISCORD_TOKEN")!; + if (!token) { + throw new Error("DISCORD_TOKEN not found"); + } + + const botId = BigInt(atob(token.split(".")[0])); + let startedAt = 0; const bot = createBot({ // token: TOKEN || Deno.env.get("DISCORD_TOKEN"), token: Deno.env.get("DISCORD_TOKEN")!, // TEST BOT - botId: 770381961553510451n, + botId, // DD bot // botId: 675412054529540107n, events: createEventHandlers({