Fix VoiceStateUpdate

This commit is contained in:
Christer Warén 2021-08-04 13:52:30 +03:00
parent b2ae9ef6f0
commit 251eb7f5a1

View File

@ -21,8 +21,8 @@ module.exports = {
);
} catch (error) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection.dispatcher.destroy();
radio.voiceChannel.leave();
radio.connection.destroy();
radio.audioPlayer.stop();
client.radio.delete(oldState.guild.id);
}
return;
@ -38,8 +38,8 @@ module.exports = {
if (!radio || !radio.connection.dispatcher || !radio.connection.dispatcher === null) return;
if (radio.voiceChannel.members.size === 1) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection.dispatcher.destroy();
radio.voiceChannel.leave();
radio.connection.destroy();
radio.audioPlayer.stop();
client.radio.delete(newState.guild.id);
}
}, 120000);