From 2ba00038d158ca40d59a9c83e2ac4f25e9d4baf0 Mon Sep 17 00:00:00 2001 From: sillyfrog <816454+sillyfrog@users.noreply.github.com> Date: Sat, 20 Oct 2018 02:15:01 +1000 Subject: [PATCH] fix(VoiceConnection): use Speaking#has to fire _stoppedSpeaking (#2896) * Use match on speaking bitmask to fire _stoppedSpeaking * Use constants and correct matching * Correctly do a not check --- src/client/voice/VoiceConnection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js index 6e0557995..7dc06fa3d 100644 --- a/src/client/voice/VoiceConnection.js +++ b/src/client/voice/VoiceConnection.js @@ -447,12 +447,12 @@ class VoiceConnection extends EventEmitter { */ if (this.status === VoiceStatus.CONNECTED) { this.emit('speaking', user, speaking); - if (!speaking) { + if (!speaking.has(Speaking.FLAGS.SPEAKING)) { this.receiver.packets._stoppedSpeaking(user_id); } } - if (guild && user && old !== speaking) { + if (guild && user && !old.equals(speaking)) { const member = guild.member(user); if (member) { /**