From c7eb3a9b0c717a7c939bfda5ef88967f5432eca1 Mon Sep 17 00:00:00 2001 From: ITOH Date: Sun, 29 May 2022 18:22:56 +0200 Subject: [PATCH] hotfix: release: 13.0.0-rc45 Fixed: - startBot shard data calculation - propper handling for websocket close code 1000 Changed: - shard shutdown code to 3000 --- bot.ts | 2 +- gateway/shard/handleClose.ts | 5 ++--- gateway/shard/types.ts | 6 ++---- types/shared.ts | 4 ++++ util/constants.ts | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bot.ts b/bot.ts index 90b7bcb39..7eb1a2396 100644 --- a/bot.ts +++ b/bot.ts @@ -260,7 +260,7 @@ export function createEventHandlers( } export async function startBot(bot: Bot) { - if (!bot.botGatewayData) { + if (!Object.keys(bot.botGatewayData ?? {}).length) { bot.gateway.gatewayBot = await bot.helpers.getGatewayBot(); bot.gateway.lastShardId = bot.gateway.gatewayBot.shards - 1; bot.gateway.manager.totalShards = bot.gateway.gatewayBot.shards; diff --git a/gateway/shard/handleClose.ts b/gateway/shard/handleClose.ts index e2ff6899a..59f8df485 100644 --- a/gateway/shard/handleClose.ts +++ b/gateway/shard/handleClose.ts @@ -7,7 +7,6 @@ export async function handleClose(shard: Shard, close: CloseEvent): Promise