diff --git a/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java b/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java index 5bdedd0..315f637 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java @@ -38,6 +38,7 @@ public class MusicCommand extends Command { ) .then(literal("stop").executes(this::stop)) + .then(literal("skip").executes(this::skip)) .then(literal("pause").executes(this::pause)) .then(literal("list").executes(this::list)) @@ -74,7 +75,20 @@ public class MusicCommand extends Command { if (songPlayer.currentSong() == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); songPlayer.stopPlaying(); - source.sendOutput(Component.translatable("Stopped playing the current song", NamedTextColor.GREEN)); + songPlayer.songQueue().clear(); + source.sendOutput(Component.translatable("Stopped music playback", NamedTextColor.GREEN)); + + return 1; + } + + public int skip (CommandContext context) throws CommandSyntaxException { + final CommandSource source = context.getSource(); + final SongPlayer songPlayer = source.client().songPlayer(); + + if (songPlayer.currentSong() == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); + + songPlayer.stopPlaying(); + source.sendOutput(Component.translatable("Skipped the current song", NamedTextColor.GREEN)); return 1; }