From 45c878d39011cff1028cde93c555267c63deb889 Mon Sep 17 00:00:00 2001 From: Awesome Stickz Date: Sat, 30 Sep 2023 19:44:05 +0530 Subject: [PATCH] fix(bot): bug with overriding lastShardId if it's not provided in createBot() options (#3141) * fix(gateway): bug with overriding lastShardId if it's not provided in createBot() options * fix the fix --- packages/bot/src/bot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bot/src/bot.ts b/packages/bot/src/bot.ts index b110ae41f..5fbb66a65 100644 --- a/packages/bot/src/bot.ts +++ b/packages/bot/src/bot.ts @@ -75,7 +75,7 @@ export function createBot(options: CreateBotOptions): Bot { if (!options.gateway?.totalShards) bot.gateway.totalShards = bot.gateway.connection.shards - if (!options.gateway?.lastShardId) bot.gateway.lastShardId = bot.gateway.connection.shards - 1 + if (!options.gateway?.lastShardId && !options.gateway?.totalShards) bot.gateway.lastShardId = bot.gateway.connection.shards - 1 } await bot.gateway.spawnShards()