diff --git a/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java b/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java index b78c4b7..9ae70e2 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chipmunkbot/commands/MusicCommand.java @@ -13,6 +13,7 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.JoinConfiguration; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.TextColor; import java.io.File; @@ -92,13 +93,17 @@ public class MusicCommand { } public int play (CommandContext context) { - final SongPlayer songPlayer = context.getSource().client().songPlayer(); + final CommandSource source = context.getSource(); + + final SongPlayer songPlayer = source.client().songPlayer(); final Path path = getPath(context, "location"); - songPlayer.loadSong(path); -// if (path != null) songPlayer.loadSong(path); -// else songPlayer.loadSong(getUrl(context, "location")); + if (path != null) songPlayer.loadSong(path); + else { + source.sendOutput(Component.text("no").color(NamedTextColor.RED)); + // songPlayer.loadSong(getUrl(context, "location")); + } return 1; }