From 480e0b1d3c7c3e74677ca3181e17586bad97f9a2 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Thu, 29 Apr 2021 18:50:49 -0600 Subject: [PATCH] fr this time istg --- events/voiceStateUpdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/events/voiceStateUpdate.js b/events/voiceStateUpdate.js index b80e837..c1ef903 100644 --- a/events/voiceStateUpdate.js +++ b/events/voiceStateUpdate.js @@ -10,7 +10,7 @@ module.exports = async (client, oldState, voice) => { } else { if (!client.misc.cache.inVC.includes(voice.member.id)) {return;} client.misc.cache.inVC.splice(client.misc.cache.inVC.indexOf(voice.member.id), 1); - if (!voice.channel.members.size && client.misc.cache.activeVC.includes(voice.channelID)) {client.misc.cache.activeVC.splice(client.misc.cache.activeVC.indexOf(voice.channelID), 1);} + if (oldState.channel && !oldState.channel.members.size && client.misc.cache.activeVC.includes(oldState.channelID)) {client.misc.cache.activeVC.splice(client.misc.cache.activeVC.indexOf(oldState.channelID), 1);} if (Object.keys(client.misc.cache.VCG).includes(voice.member.id)) {delete client.misc.cache.VCG[voice.member.id];} } }