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
This commit is contained in:
Awesome Stickz
2023-09-30 14:14:05 +00:00
committed by GitHub
parent 6572238ce8
commit 45c878d390
+1 -1
View File
@@ -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()