SPEEDY !!!!

This commit is contained in:
Chayapak 2023-08-23 21:10:17 +07:00
parent a58c15ce67
commit 411be7ce29

View file

@ -370,11 +370,15 @@ public class MusicCommand extends Command {
return Component.text("Invalid speed").color(NamedTextColor.RED); 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; bot.music.speed = speed;
currentSong.setTime(oldTime); if (currentSong != null) currentSong.setTime(oldTime);
return Component.empty() return Component.empty()
.append(Component.text("Set the speed to ")) .append(Component.text("Set the speed to "))