From d800c2305786bee97a4a7d6f8a3fa919cdd7d8b4 Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Thu, 21 Jul 2022 17:56:44 +0545 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Make=20sure=20to=20pass=20a=20bo?= =?UTF-8?q?olean=20to=20setPaused?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Player.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 1123526..04894a1 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -88,9 +88,11 @@ class Player extends EventEmitter { if (!oldState.channelId && newState.channelId && newState.member.id === newState.guild.members.me.id) { if (!oldState.serverMute && newState.serverMute) { - queue.setPaused(newState.serverMute); + // state.serverMute can be null + queue.setPaused(!!newState.serverMute); } else if (!oldState.suppress && newState.suppress) { - queue.setPaused(newState.suppress); + // state.suppress can be null + queue.setPaused(!!newState.suppress); if (newState.suppress) { newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop); } @@ -99,9 +101,11 @@ class Player extends EventEmitter { if (oldState.channelId === newState.channelId && newState.member.id === newState.guild.members.me.id) { if (!oldState.serverMute && newState.serverMute) { - queue.setPaused(newState.serverMute); + // state.serverMute can be null + queue.setPaused(!!newState.serverMute); } else if (!oldState.suppress && newState.suppress) { - queue.setPaused(newState.suppress); + // state.suppress can be null + queue.setPaused(!!newState.suppress); if (newState.suppress) { newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop); }