spotify is v silly!

This commit is contained in:
Lee 2024-06-28 04:04:50 +01:00
parent bf554933cc
commit d77c937818
3 changed files with 15 additions and 16 deletions

@ -42,13 +42,13 @@ public class CurrentSubCommand extends BatSubCommand {
return;
}
// if (!spotifyService.hasTrackPlaying(user)) {
// interaction.replyEmbeds(EmbedUtils.genericEmbed()
// .setDescription("You are not currently playing a track.")
// .build())
// .queue();
// return;
// }
if (!spotifyService.hasTrackPlaying(user)) {
interaction.replyEmbeds(EmbedUtils.genericEmbed()
.setDescription("You are not currently playing a track.")
.build())
.queue();
return;
}
CurrentlyPlaying currentlyPlaying = spotifyService.getCurrentlyPlayingTrack(user);
Track track = (Track) currentlyPlaying.getItem();
AlbumSimplified album = track.getAlbum();

@ -36,13 +36,13 @@ public class PauseSubCommand extends BatSubCommand {
return;
}
// if (!spotifyService.hasTrackPlaying(user)) {
// interaction.replyEmbeds(EmbedUtils.genericEmbed()
// .setDescription("You need to be playing a track to pause it.")
// .build())
// .queue();
// return;
// }
if (!spotifyService.hasTrackPlaying(user)) {
interaction.replyEmbeds(EmbedUtils.genericEmbed()
.setDescription("You need to be playing a track to pause it.")
.build())
.queue();
return;
}
boolean didPause = spotifyService.pausePlayback(user);
interaction.replyEmbeds(EmbedUtils.genericEmbed()

@ -86,8 +86,7 @@ public class SpotifyService {
try {
return getSpotifyApi(user).getUsersCurrentlyPlayingTrack().build().execute();
} catch (Exception e) {
e.printStackTrace();
return null;
throw new RuntimeException("Failed to get currently playing track", e);
}
}