🐛 Make sure to pass a boolean to setPaused

This commit is contained in:
DevAndromeda 2022-07-21 17:56:44 +05:45
parent b643367862
commit d800c23057

View file

@ -88,9 +88,11 @@ class Player extends EventEmitter<PlayerEvents> {
if (!oldState.channelId && newState.channelId && newState.member.id === newState.guild.members.me.id) { if (!oldState.channelId && newState.channelId && newState.member.id === newState.guild.members.me.id) {
if (!oldState.serverMute && newState.serverMute) { if (!oldState.serverMute && newState.serverMute) {
queue.setPaused(newState.serverMute); // state.serverMute can be null
queue.setPaused(!!newState.serverMute);
} else if (!oldState.suppress && newState.suppress) { } else if (!oldState.suppress && newState.suppress) {
queue.setPaused(newState.suppress); // state.suppress can be null
queue.setPaused(!!newState.suppress);
if (newState.suppress) { if (newState.suppress) {
newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop); newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop);
} }
@ -99,9 +101,11 @@ class Player extends EventEmitter<PlayerEvents> {
if (oldState.channelId === newState.channelId && newState.member.id === newState.guild.members.me.id) { if (oldState.channelId === newState.channelId && newState.member.id === newState.guild.members.me.id) {
if (!oldState.serverMute && newState.serverMute) { if (!oldState.serverMute && newState.serverMute) {
queue.setPaused(newState.serverMute); // state.serverMute can be null
queue.setPaused(!!newState.serverMute);
} else if (!oldState.suppress && newState.suppress) { } else if (!oldState.suppress && newState.suppress) {
queue.setPaused(newState.suppress); // state.suppress can be null
queue.setPaused(!!newState.suppress);
if (newState.suppress) { if (newState.suppress) {
newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop); newState.guild.members.me.voice.setRequestToSpeak(true).catch(Util.noop);
} }