Fix off by one error
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user