mirror of
https://github.com/MinazukiAmane/Tinasha-Bot.git
synced 2025-03-15 07:35:57 +08:00
should fix the bot crash
this should fix the bot crash when the bot is disconnected because of voice channels is gone, or reconnecting to the voice channel but without any music, not tested yet
This commit is contained in:
parent
68c9980703
commit
0bf035c71f
@ -22,9 +22,9 @@ module.exports = async (client, oldState, newState) => {
|
||||
if (oldState.channel.members.size === 1) {
|
||||
setTimeout(() => {
|
||||
// if 1 (you), wait 1 minute
|
||||
if (!oldState.channel.members.size - 1) {
|
||||
const player = client.musicManager.players.resolve(guild.id);
|
||||
if (player) client.musicManager.getPlayer(guild.id).destroy(); // destroy the player
|
||||
if (oldState.channel.members.size === 1) {
|
||||
const player = client.musicManager.getPlayer(guild.id);
|
||||
if (player) player.destroy(); // destroy the player
|
||||
}
|
||||
}, client.config.MUSIC.IDLE_TIME * 1000);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user