diff --git a/src/bot.ts b/src/bot.ts index 92d2182b9..4fe7562ed 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -31,6 +31,8 @@ export async function startBot(config: BotConfig) { // Initial API connection to get info about bots connection ws.botGatewayData = await getGatewayBot(); ws.maxShards = ws.maxShards || ws.botGatewayData.shards; + ws.lastShardId = + ws.lastShardId === 1 ? ws.botGatewayData.shards : ws.lastShardId; // Explicitly append gateway version and encoding ws.botGatewayData.url += `?v=${GATEWAY_VERSION}&encoding=json`;