From bc3076782ee7a6584ac16b4b644cc4c3f5c1ba5f Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 5 Nov 2021 18:06:38 +0000 Subject: [PATCH] fix shard bug --- src/bot.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bot.ts b/src/bot.ts index a4ba8c702..9b4044c85 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -277,6 +277,8 @@ export async function startBot(bot: Bot) { sessionStartLimitRemaining: bot.botGatewayData.sessionStartLimit.remaining, sessionStartLimitResetAfter: bot.botGatewayData.sessionStartLimit.resetAfter, maxConcurrency: bot.botGatewayData.sessionStartLimit.maxConcurrency, + lastShardId: bot.botGatewayData.shards, + maxShards: bot.botGatewayData.shards, debug: bot.events.debug, handleDiscordPayload: // bot.handleDiscordPayload || @@ -389,7 +391,7 @@ export function createGatewayManager( shardsPerCluster: options.shardsPerCluster ?? 25, maxClusters: options.maxClusters ?? 4, firstShardId: options.firstShardId ?? 0, - lastShardId: options.lastShardId ?? 1, + lastShardId: options.lastShardId ?? options.maxShards ?? options.shardsRecommended ?? 1, token: options.token ?? "", compress: options.compress ?? false, $os: options.$os ?? "linux",