mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Merge branch 'master' into voice-rewrite
This commit is contained in:
@@ -269,13 +269,15 @@ class WebSocketConnection extends EventEmitter {
|
||||
|
||||
this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH);
|
||||
if (!flush) return;
|
||||
let packet;
|
||||
try {
|
||||
const packet = WebSocket.unpack(this.inflate.result);
|
||||
this.onPacket(packet);
|
||||
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
|
||||
packet = WebSocket.unpack(this.inflate.result);
|
||||
} catch (err) {
|
||||
this.client.emit('debug', err);
|
||||
return;
|
||||
}
|
||||
this.onPacket(packet);
|
||||
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user