mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix(gateway,bot): socket close debug handling & last/totalShards (#2261)
This commit is contained in:
@@ -262,6 +262,8 @@ export function createEventHandlers(
|
||||
export async function startBot(bot: Bot) {
|
||||
if (!bot.botGatewayData) {
|
||||
bot.gateway.gatewayBot = await bot.helpers.getGatewayBot();
|
||||
bot.gateway.lastShardId = bot.gateway.gatewayBot.shards - 1;
|
||||
bot.gateway.manager.totalShards = bot.gateway.gatewayBot.shards;
|
||||
}
|
||||
|
||||
bot.gateway.spawnShards();
|
||||
|
||||
@@ -6,12 +6,8 @@ export async function handleClose(shard: Shard, close: CloseEvent): Promise<void
|
||||
|
||||
shard.stopHeartbeating();
|
||||
|
||||
console.log({ id: shard.id, close });
|
||||
|
||||
switch (close.code) {
|
||||
case ShardSocketCloseCodes.Shutdown: {
|
||||
throw new Error("SHUTDOWN");
|
||||
}
|
||||
// These events
|
||||
case ShardSocketCloseCodes.TestingFinished: {
|
||||
shard.state = ShardState.Offline;
|
||||
shard.events.disconnected?.(shard);
|
||||
|
||||
Reference in New Issue
Block a user