diff --git a/src/client/websocket/WebSocketConnection.js b/src/client/websocket/WebSocketConnection.js index af4a20e8d..d723ac79a 100644 --- a/src/client/websocket/WebSocketConnection.js +++ b/src/client/websocket/WebSocketConnection.js @@ -290,7 +290,9 @@ class WebSocketConnection extends EventEmitter { } catch (err) { this.emit('debug', err); } - return this.onPacket(data); + const ret = this.onPacket(data); + this.client.emit('raw', data); + return ret; } /** @@ -311,7 +313,6 @@ class WebSocketConnection extends EventEmitter { this.debug('Received null packet'); return false; } - this.client.emit('raw', packet); switch (packet.op) { case Constants.OPCodes.HELLO: return this.heartbeat(packet.d.heartbeat_interval);