mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
only close if open
This commit is contained in:
@@ -10,7 +10,7 @@ export async function tellClusterToIdentify(
|
|||||||
const oldShard = ws.shards.get(shardId);
|
const oldShard = ws.shards.get(shardId);
|
||||||
await ws.identify(shardId, ws.maxShards);
|
await ws.identify(shardId, ws.maxShards);
|
||||||
|
|
||||||
if (oldShard) {
|
if (oldShard?.ws.readyState === WebSocket.OPEN) {
|
||||||
oldShard.ws.close(3065, "Resharded!");
|
oldShard.ws.close(3065, "Resharded!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user