From ead52decf25007dcfb8536e91a88a31a10498c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 16 Sep 2021 19:43:19 +0300 Subject: [PATCH] Update voiceStateUpdate event --- src/client/events/voiceStateUpdate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/events/voiceStateUpdate.js b/src/client/events/voiceStateUpdate.js index d180e2c..8ae732e 100644 --- a/src/client/events/voiceStateUpdate.js +++ b/src/client/events/voiceStateUpdate.js @@ -51,17 +51,17 @@ module.exports = { //radio.connection = await newState.channel.join(); } } - if ((oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel) || change) { + if ((oldState.channel.members.filter(member => !member.user.bot).size === 0 && oldState.channel === radio.voiceChannel) || change) { setTimeout(() => { if (!radio || !radio.connection || !radio.connection === null) return; - if (radio.voiceChannel.members.size === 1) { + if (radio.voiceChannel.members.filter(member => !member.user.bot).size === 0) { client.statistics.update(client, newState.guild, radio); radio.connection?.destroy(); radio.message?.delete(); client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop'); client.radio.delete(newState.guild.id); } - }, 60000); + }, 5000); } }, };