fix(clientpresence): fix used opcodes (#7415)

This commit is contained in:
Tobias Peltzer
2022-02-07 11:51:11 +01:00
committed by GitHub
parent aadfbda586
commit a921ec7dc5

View File

@@ -22,13 +22,13 @@ class ClientPresence extends Presence {
const packet = this._parse(presence);
this._patch(packet);
if (typeof presence.shardId === 'undefined') {
this.client.ws.broadcast({ op: GatewayOpcodes.StatusUpdate, d: packet });
this.client.ws.broadcast({ op: GatewayOpcodes.PresenceUpdate, d: packet });
} else if (Array.isArray(presence.shardId)) {
for (const shardId of presence.shardId) {
this.client.ws.shards.get(shardId).send({ op: GatewayOpcodes.StatusUpdate, d: packet });
this.client.ws.shards.get(shardId).send({ op: GatewayOpcodes.PresenceUpdate, d: packet });
}
} else {
this.client.ws.shards.get(presence.shardId).send({ op: GatewayOpcodes.StatusUpdate, d: packet });
this.client.ws.shards.get(presence.shardId).send({ op: GatewayOpcodes.PresenceUpdate, d: packet });
}
return this;
}