mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
move raw call so that any cache events happen before (#1653)
* move raw call so that any cache events happen before * Update WebSocketConnection.js * Update WebSocketConnection.js
This commit is contained in:
parent
afcf43aef6
commit
2eb3720001
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue