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
This commit is contained in:
sillyfrog
2018-10-20 02:15:01 +10:00
committed by SpaceEEC
parent e189c1b728
commit 2ba00038d1

View File

@@ -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) {
/**