diff --git a/template/bigbot/src/gateway/mod.ts b/template/bigbot/src/gateway/mod.ts index a96e6e546..bbb53a60e 100644 --- a/template/bigbot/src/gateway/mod.ts +++ b/template/bigbot/src/gateway/mod.ts @@ -1,10 +1,5 @@ import { Collection, createGatewayManager, createRestManager, endpoints } from "../../deps.ts"; -import { - DISCORD_TOKEN, - EVENT_HANDLER_SECRET_KEY, - REST_AUTHORIZATION_KEY, - REST_PORT, -} from "../../configs.ts"; +import { DISCORD_TOKEN, EVENT_HANDLER_SECRET_KEY, REST_AUTHORIZATION_KEY, REST_PORT } from "../../configs.ts"; // CREATE A SIMPLE MANAGER FOR REST const rest = createRestManager({ @@ -43,8 +38,8 @@ async function startGateway() { gateway.sessionStartLimitRemaining = result.sessionStartLimit.remaining; gateway.sessionStartLimitResetAfter = result.sessionStartLimit.resetAfter; gateway.maxConcurrency = result.sessionStartLimit.maxConcurrency; - gateway.maxShards = result.shards - gateway.lastShardId = result.shards + gateway.maxShards = result.shards; + gateway.lastShardId = result.shards; // PREPARE BUCKETS FOR IDENTIFYING gateway.prepareBuckets(gateway, 0, result.shards); @@ -124,7 +119,6 @@ async function startGateway() { startGateway(); - setInterval(async () => { console.log("GW DEBUG", "[Resharding] Checking if resharding is needed."); diff --git a/template/bigbot/src/gateway/worker.ts b/template/bigbot/src/gateway/worker.ts index fe3999da9..28c0f21dd 100644 --- a/template/bigbot/src/gateway/worker.ts +++ b/template/bigbot/src/gateway/worker.ts @@ -1,10 +1,4 @@ -import { - BOT_ID, - DISCORD_TOKEN, - EVENT_HANDLER_PORT, - EVENT_HANDLER_SECRET_KEY, - EVENT_HANDLER_URL, -} from "../../configs.ts"; +import { DISCORD_TOKEN, EVENT_HANDLER_PORT, EVENT_HANDLER_SECRET_KEY, EVENT_HANDLER_URL } from "../../configs.ts"; import { Collection, createGatewayManager, DiscordReady, GatewayManager, GetGatewayBot } from "../../deps.ts"; let gateway: GatewayManager; @@ -53,7 +47,9 @@ function spawnGateway(shardId: number, options: Partial) { } // DONT SEND THESE EVENTS USELESS TO BOT - if (["GUILD_LOADED_DD"].includes(data.t)) return; + if (["GUILD_LOADED_DD"].includes(data.t)) { + return; + } await fetch(`${EVENT_HANDLER_URL}:${EVENT_HANDLER_PORT}`, { headers: { @@ -67,7 +63,9 @@ function spawnGateway(shardId: number, options: Partial) { }), }) // BELOW IS FOR DENO MEMORY LEAK - .then((res) => res.text()) + .then((res) => + res.text() + ) .catch(() => null); }, });