fix: delete loader thread on *music stop and disconnect
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user