From e2a01b11437f6953fea3dd99068b28656efe5f19 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:09:23 +0000 Subject: [PATCH] fix(gw): thx dv8. invalid condition on identify --- gateway/shard/identify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/shard/identify.ts b/gateway/shard/identify.ts index 6cd75897a..8d9ce59f4 100644 --- a/gateway/shard/identify.ts +++ b/gateway/shard/identify.ts @@ -4,7 +4,7 @@ import { Shard, ShardSocketCloseCodes, ShardState } from "./types.ts"; export async function identify(shard: Shard): Promise { // A new identify has been requested even though there is already a connection open. // Therefore we need to close the old connection and heartbeating before creating a new one. - if (shard.state === ShardState.Connected) { + if (shard.isOpen()) { console.log("CLOSING EXISTING SHARD: #" + shard.id); shard.close(ShardSocketCloseCodes.ReIdentifying, "Re-identifying closure of old connection."); }