feature: public raw events (#3159)

* add a public alternative to the private raw event

while retaining raw for use in debugging privately

* only emit dispatch packets

* requested changes

TIL, that's neat

* fix padding

* requested changes

* Update WebSocketManager.js
This commit is contained in:
bdistin
2019-04-29 11:37:57 -05:00
committed by Amish Shah
parent 870528ed33
commit 9b0f4b298d
3 changed files with 11 additions and 2 deletions

4
typings/index.d.ts vendored
View File

@@ -1291,7 +1291,7 @@ declare module 'discord.js' {
constructor(id: string, token: string, options?: ClientOptions);
}
export class WebSocketManager {
export class WebSocketManager extends EventEmitter {
constructor(client: Client);
private totalShards: number | string;
private shardQueue: Set<WebSocketShard>;
@@ -1306,6 +1306,8 @@ declare module 'discord.js' {
public status: Status;
public readonly ping: number;
public on(event: WSEventType, listener: (data: any, shardID: number) => void): this;
public once(event: WSEventType, listener: (data: any, shardID: number) => void): this;
private debug(message: string, shard?: WebSocketShard): void;
private connect(): Promise<void>;
private createShards(): Promise<void>;