From 411be7ce296995731cfbbbd03c097a7c3e4f3f28 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:10:17 +0700 Subject: [PATCH] SPEEDY !!!! --- .../chayapak/chomens_bot/commands/MusicCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java index 9334871..0c38727 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java @@ -370,11 +370,15 @@ public class MusicCommand extends Command { return Component.text("Invalid speed").color(NamedTextColor.RED); } - final long oldTime = currentSong.time; + if (speed > 5) return Component.text("Too fast").color(NamedTextColor.RED); + + long oldTime = -1; + + if (currentSong != null) oldTime = currentSong.time; bot.music.speed = speed; - currentSong.setTime(oldTime); + if (currentSong != null) currentSong.setTime(oldTime); return Component.empty() .append(Component.text("Set the speed to "))