mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
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:
@@ -257,6 +257,7 @@ class WebSocketShard extends EventEmitter {
|
||||
try {
|
||||
packet = WebSocket.unpack(this.inflate.result);
|
||||
this.manager.client.emit(Events.RAW, packet, this.id);
|
||||
if (packet.op === OPCodes.DISPATCH) this.manager.emit(packet.t, packet.d, this.id);
|
||||
} catch (err) {
|
||||
this.manager.client.emit(Events.SHARD_ERROR, err, this.id);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user