fix: delete loader thread on *music stop and disconnect

This commit is contained in:
ChomeNS
2025-04-03 20:27:54 +07:00
parent db1be06b17
commit a711e21437
3 changed files with 3 additions and 1 deletions

View File

@@ -224,6 +224,7 @@ public class MusicCommand extends Command {
final Bot bot = context.bot;
bot.music.stopPlaying();
bot.music.songQueue.clear();
bot.music.loaderThread = null;
return Component.text("Cleared the song queue").color(ColorUtilities.getColorByString(bot.config.colorPalette.defaultColor));
}

View File

@@ -369,6 +369,7 @@ public class MusicPlayerPlugin extends Bot.Listener implements CorePlugin.Listen
@Override
public void disconnected (DisconnectedEvent event) {
if (currentSong != null) currentSong.pause(); // nice.
loaderThread = null;
}
public void handlePlaying () {