diff --git a/src/bot.ts b/src/bot.ts index 264791627..b531b1334 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,4 +1,5 @@ import { getGatewayBot } from "./helpers/misc/get_gateway_bot.ts"; +import { rest } from "./rest/rest.ts"; import { DiscordGatewayIntents } from "./types/gateway/gateway_intents.ts"; import { DiscordGetGatewayBot } from "./types/gateway/get_gateway_bot.ts"; import { baseEndpoints, GATEWAY_VERSION } from "./util/constants.ts"; @@ -30,6 +31,7 @@ export async function startBot(config: BotConfig) { if (config.eventHandlers) eventHandlers = config.eventHandlers; authorization = `Bot ${config.token}`; ws.identifyPayload.token = `Bot ${config.token}`; + rest.token = `Bot ${config.token}`; ws.identifyPayload.intents = config.intents.reduce( ( bits, diff --git a/src/rest/rest.ts b/src/rest/rest.ts index 8cc3130ca..a2853f8e0 100644 --- a/src/rest/rest.ts +++ b/src/rest/rest.ts @@ -9,6 +9,8 @@ import { processRequestHeaders } from "./process_request_headers.ts"; import { runMethod } from "./run_method.ts"; export const rest = { + /** The bot token for this rest client. */ + token: "", apiVersion: "8", /** The secret authorization key to confirm that this was a request made by you and not a DDOS attack. */ authorization: "discordeno_best_lib_ever",