fix: set last shard id

This commit is contained in:
ITOH
2021-05-13 19:02:16 +02:00
parent c16f211ce7
commit 64e433f461
+2
View File
@@ -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`;