mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
Fix reconnect when using WS (#952)
* Fix reconnect when using WS * Add disconnect status (fix reconnect with WS)
This commit is contained in:
parent
977e29ceba
commit
8eff36b744
2 changed files with 2 additions and 0 deletions
|
|
@ -216,6 +216,7 @@ class WebSocketManager extends EventEmitter {
|
||||||
eventClose(event) {
|
eventClose(event) {
|
||||||
this.emit('close', event);
|
this.emit('close', event);
|
||||||
this.client.clearInterval(this.client.manager.heartbeatInterval);
|
this.client.clearInterval(this.client.manager.heartbeatInterval);
|
||||||
|
this.status = Constants.Status.DISCONNECTED;
|
||||||
/**
|
/**
|
||||||
* Emitted whenever the client websocket is disconnected
|
* Emitted whenever the client websocket is disconnected
|
||||||
* @event Client#disconnect
|
* @event Client#disconnect
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ exports.Status = {
|
||||||
RECONNECTING: 2,
|
RECONNECTING: 2,
|
||||||
IDLE: 3,
|
IDLE: 3,
|
||||||
NEARLY: 4,
|
NEARLY: 4,
|
||||||
|
DISCONNECTED: 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.ChannelTypes = {
|
exports.ChannelTypes = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue