From bf151ec1193de540bd1043dd7a57683607756a92 Mon Sep 17 00:00:00 2001 From: Skillz Date: Thu, 25 Feb 2021 15:30:07 -0500 Subject: [PATCH] so freaking shitty dumnb aefiuhesr error fix --- src/ws/proxy/manager.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ws/proxy/manager.ts b/src/ws/proxy/manager.ts index 349e7b11e..f484ce47b 100644 --- a/src/ws/proxy/manager.ts +++ b/src/ws/proxy/manager.ts @@ -1,4 +1,4 @@ -import { getGatewayBot } from "../../api/handlers/gateway.ts"; +import { DiscordBotGatewayData } from "../../types/discord.ts"; import { Intents } from "../../types/options.ts"; import { Collection } from "../../util/collection.ts"; import { ws } from "./ws.ts"; @@ -26,7 +26,11 @@ export async function startGateway(options: StartGatewayOptions) { 0, ); - const data = await getGatewayBot(); + const data = await fetch( + `https://discord.com/api/gateway/bot`, + { headers: { Authorization: ws.identifyPayload.token } }, + ).then((res) => res.json()) as DiscordBotGatewayData; + ws.maxShards = options.maxShards || data.shards; ws.lastShardID = options.lastShardID || data.shards - 1;