mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
add auth session change handling (#1339)
* add auth session change handling * eek
This commit is contained in:
@@ -71,6 +71,16 @@ class WebSocketPacketManager {
|
||||
}
|
||||
|
||||
handle(packet) {
|
||||
if (packet.t === Constants.WSEvents.AUTH_SESSION_CHANGE) {
|
||||
if (packet.d.new_token) {
|
||||
this.client.token = packet.d.new_token;
|
||||
this.ws._sendResume();
|
||||
} else {
|
||||
this.client.destroy();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (packet.op === Constants.OPCodes.RECONNECT) {
|
||||
this.setSequence(packet.s);
|
||||
this.ws.tryReconnect();
|
||||
|
||||
Reference in New Issue
Block a user