From 48036bdad577740c3b3ccf839870b7c190a1618a Mon Sep 17 00:00:00 2001 From: AlTech98 Date: Fri, 3 Sep 2021 14:23:33 +0200 Subject: [PATCH] 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(-) 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 },