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:
Vlad Frangu
2020-01-13 20:53:07 +02:00
committed by Amish Shah
parent 45cd58b68c
commit c23cc7a42e
3 changed files with 29 additions and 5 deletions

1
typings/index.d.ts vendored
View File

@@ -1717,6 +1717,7 @@ declare module 'discord.js' {
private _send(data: object): void;
private processQueue(): void;
private destroy(closeCode: number): void;
private _cleanupConnection(): void;
public send(data: object): void;
public on(event: 'ready', listener: () => void): this;