From b9f0eb3a964cdd02ae795f568f6e0aeead046080 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Fri, 20 Mar 2020 22:55:31 +0200 Subject: [PATCH] Update voiceStateUpdate.js --- events/clientEvents/voiceStateUpdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/clientEvents/voiceStateUpdate.js b/events/clientEvents/voiceStateUpdate.js index d287afe2..8f980ca5 100644 --- a/events/clientEvents/voiceStateUpdate.js +++ b/events/clientEvents/voiceStateUpdate.js @@ -1,6 +1,7 @@ module.exports = { name: 'voiceStateUpdate', async execute(client, oldState, newState) { + if (oldState.channel === null) return newState.setSelfDeaf(true); let change = false; const queue = client.queue.get(newState.guild.id); if (!queue) return; @@ -17,7 +18,6 @@ module.exports = { queue.connection = newState.connection; } } - if (oldState.channel === null) return; if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) { setTimeout(() => { if (!queue) return;