From c8345b3223bb3825c151bd811a5b6460b1bfbc38 Mon Sep 17 00:00:00 2001 From: AlTech98 Date: Fri, 3 Sep 2021 14:23:33 +0200 Subject: Fix to send the voice leave event only to the right session --- gateway/src/opcodes/VoiceStateUpdate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gateway/src/opcodes') diff --git a/gateway/src/opcodes/VoiceStateUpdate.ts b/gateway/src/opcodes/VoiceStateUpdate.ts index 668508fd..fba0db1f 100644 --- a/gateway/src/opcodes/VoiceStateUpdate.ts +++ b/gateway/src/opcodes/VoiceStateUpdate.ts @@ -23,7 +23,7 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { } //If a user change voice channel between guild we should send a left event first - if (voiceState.guild_id !== body.guild_id) { + if (voiceState.guild_id !== body.guild_id && voiceState.session_id === this.session_id) { await emitEvent({ event: "VOICE_STATE_UPDATE", data: { ...voiceState, channel_id: null }, -- cgit 1.5.1