diff --git a/DiscordClient.js b/DiscordClient.js index 4da82d1..3d61044 100644 --- a/DiscordClient.js +++ b/DiscordClient.js @@ -49,6 +49,7 @@ class DiscordClient extends EventEmitter { this._heartbeatInterval = setInterval(() => { if (!this.gotServerHeartbeatACK) { + logError("Closing due to no heartbeat ACK..."); this.ws.close(1000, "No heartbeat ACK."); return; } @@ -227,6 +228,13 @@ class DiscordClient extends EventEmitter { this.ws = null; } + setTimeout(() => { + if (!this.__init) { + this.__init = true; + this.ws.close(); + } + }, 6000) + const ws = new WebSocket(this.gatewayUrl); this.ws = ws;