mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 09:53:18 +00:00
Update voiceStateUpdate event
This commit is contained in:
parent
7757788f99
commit
ead52decf2
@ -51,17 +51,17 @@ module.exports = {
|
|||||||
//radio.connection = await newState.channel.join();
|
//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(() => {
|
setTimeout(() => {
|
||||||
if (!radio || !radio.connection || !radio.connection === null) return;
|
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);
|
client.statistics.update(client, newState.guild, radio);
|
||||||
radio.connection?.destroy();
|
radio.connection?.destroy();
|
||||||
radio.message?.delete();
|
radio.message?.delete();
|
||||||
client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop');
|
client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop');
|
||||||
client.radio.delete(newState.guild.id);
|
client.radio.delete(newState.guild.id);
|
||||||
}
|
}
|
||||||
}, 60000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user