From b89d3ca0785de7213f0f97e43b92989cdc8123c6 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Thu, 25 Aug 2022 15:39:41 +0000 Subject: [PATCH] fix: missing application id Closes #2337 --- bot.ts | 2 +- handlers/misc/READY.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.ts b/bot.ts index 5641fdee3..b273250dd 100644 --- a/bot.ts +++ b/bot.ts @@ -161,7 +161,7 @@ import { export function createBot(options: CreateBotOptions): Bot { const bot = { id: options.botId ?? getBotIdFromToken(options.token), - applicationId: options.applicationId || options.botId, + applicationId: options.applicationId || options.botId || getBotIdFromToken(options.token), token: removeTokenPrefix(options.token), events: createEventHandlers(options.events ?? {}), intents: options.intents, diff --git a/handlers/misc/READY.ts b/handlers/misc/READY.ts index b438bff9d..f1d6b8616 100644 --- a/handlers/misc/READY.ts +++ b/handlers/misc/READY.ts @@ -18,6 +18,6 @@ export function handleReady(bot: Bot, data: DiscordGatewayPayload, shardId: numb payload, ); - if (!bot.id) bot.id = bot.transformers.snowflake(payload.user.id); - if (!bot.applicationId) bot.applicationId = bot.transformers.snowflake(payload.application.id); + bot.id = bot.transformers.snowflake(payload.user.id); + bot.applicationId = bot.transformers.snowflake(payload.application.id); }