Fix to send the voice leave event only to the right session

This commit is contained in:
AlTech98 2021-09-03 14:23:33 +02:00
parent 4187a8d196
commit 48036bdad5

View File

@ -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 },