fix(gw): thx dv8. invalid condition on identify

This commit is contained in:
Skillz4Killz
2022-09-13 18:09:23 +00:00
committed by GitHub
parent dfa3adc881
commit e2a01b1143

View File

@@ -4,7 +4,7 @@ import { Shard, ShardSocketCloseCodes, ShardState } from "./types.ts";
export async function identify(shard: Shard): Promise<void> {
// 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.");
}