src: fix up WebSocketShard errors (#3722)

* src: Fix up WebSocketShard errors

* typings: Forgot to update

* src: Forgot debug variable

* src: Fix issue Bella found
If the WS was not connected when the HELLO timeout passes
(CONNECTING, etc), the shard would get stuck
due to never rejecting the WebSocketShard#connect
Promise with the DESTROYED event
This commit is contained in:
Vlad Frangu
2020-02-02 12:12:58 +02:00
committed by GitHub
parent 6a381c68a2
commit b4e56d3e0e
3 changed files with 85 additions and 44 deletions

3
typings/index.d.ts vendored
View File

@@ -1727,8 +1727,9 @@ declare module 'discord.js' {
private identifyResume(): void;
private _send(data: object): void;
private processQueue(): void;
private destroy(closeCode: number): void;
private destroy(destroyOptions?: { closeCode?: number; reset?: boolean; emit?: boolean; log?: boolean }): void;
private _cleanupConnection(): void;
private _emitDestroyed(): void;
public send(data: object): void;
public on(event: 'ready', listener: () => void): this;