From 43844571ccd82a5b08abc8414611a4a006c467c1 Mon Sep 17 00:00:00 2001 From: ITOH Date: Sun, 2 Apr 2023 23:20:00 +0200 Subject: [PATCH] feat(bot): allow passing of `applicationId` (#2954) * feat(bot): allow passing of applicationId * Update packages/bot/src/bot.ts --- packages/bot/src/bot.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bot/src/bot.ts b/packages/bot/src/bot.ts index afe558285..23198d81e 100644 --- a/packages/bot/src/bot.ts +++ b/packages/bot/src/bot.ts @@ -32,7 +32,7 @@ import type { VoiceState } from './transformers/voiceState.js' * @returns Bot */ export function createBot(options: CreateBotOptions): Bot { - if (!options.rest) options.rest = { token: options.token } + if (!options.rest) options.rest = { token: options.token, applicationId: options.applicationId } if (!options.gateway) options.gateway = { token: options.token, events: {} } if (!options.gateway.events.message) { options.gateway.events.message = async (shard, data) => { @@ -85,6 +85,8 @@ export function createBot(options: CreateBotOptions): Bot { export interface CreateBotOptions { /** The bot's token. */ token: string + /** Application Id of the bot incase it is an old bot token. */ + applicationId?: bigint /** The bot's intents that will be used to make a connection with discords gateway. */ intents?: GatewayIntents /** Any options you wish to provide to the rest manager. */