spotify is v silly!
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 40s

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

View File

@ -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();

View File

@ -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()

View File

@ -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);
}
}