add token to rest

This commit is contained in:
Skillz4Killz
2021-04-09 13:07:24 +00:00
committed by GitHub
parent 03631e3c6e
commit 17f76b0b20
2 changed files with 4 additions and 0 deletions

View File

@@ -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,

View File

@@ -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",