mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
correctly handle invalid session (#1020)
* correctly handle invalid session * give discord some time, use it wisely
This commit is contained in:
@@ -78,8 +78,14 @@ class WebSocketPacketManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (packet.op === Constants.OPCodes.INVALID_SESSION) {
|
if (packet.op === Constants.OPCodes.INVALID_SESSION) {
|
||||||
this.ws.sessionID = null;
|
if (packet.d) {
|
||||||
this.ws._sendNewIdentify();
|
setTimeout(() => {
|
||||||
|
this.ws._sendResume();
|
||||||
|
}, 2500);
|
||||||
|
} else {
|
||||||
|
this.ws.sessionID = null;
|
||||||
|
this.ws._sendNewIdentify();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user