From c92eacb7fdeb1c65372f06d01ba6617a4dc136e8 Mon Sep 17 00:00:00 2001 From: Talon Date: Tue, 21 Mar 2023 13:40:22 +0100 Subject: [PATCH] Fix off by one error --- modules/announcer/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/announcer/index.js b/modules/announcer/index.js index 7d354c5..67be8cb 100644 --- a/modules/announcer/index.js +++ b/modules/announcer/index.js @@ -3,12 +3,11 @@ const AudioQueue=require('../../AudioQueue.js') module.exports = function (bot, api) { bot.on('voiceStateUpdate', async (oldState, newState) => { - console.log("Voice state update"); if (newState.member.user.bot) return; if (oldState.channel && newState.channel) return; const channel = oldState.channel || newState.channel; if (!channel) return; - if (channel.members.size < 1) { + if (channel.members.size < 2) { return await api.leaveChannel(channel); } await api.joinChannel(channel);