mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
src: Cleanup event listeners on WebSocket connections (#3681)
* src: Cleanup event listeners on WebSocket connections Should prevent #3641 from happening, as well as double connections on a shard * typings: Forgot to add the method
This commit is contained in:
@@ -245,6 +245,8 @@ class WebSocketManager extends EventEmitter {
|
||||
});
|
||||
|
||||
shard.on(ShardEvents.DESTROYED, () => {
|
||||
shard._cleanupConnection();
|
||||
|
||||
this.debug('Shard was destroyed but no WebSocket connection was present! Reconnecting...', shard);
|
||||
|
||||
this.client.emit(Events.SHARD_RECONNECTING, shard.id);
|
||||
|
||||
Reference in New Issue
Block a user