mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
fix: missing application id Closes #2337
This commit is contained in:
2
bot.ts
2
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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user