aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/soundchan/BotListener/BotListener.java31
-rw-r--r--src/main/java/soundchan/BotListener/Commands.java1
2 files changed, 27 insertions, 5 deletions
diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java
index 9bcccfe..e724f38 100644
--- a/src/main/java/soundchan/BotListener/BotListener.java
+++ b/src/main/java/soundchan/BotListener/BotListener.java
@@ -208,9 +208,12 @@ public class BotListener extends ListenerAdapter{
// Unpause the song/sound in the queue
unpauseTrack(channel);
- }else if(enumCommand == Commands.playingnow){
+ }else if(enumCommand == Commands.playingnow) {
// Print the currently playing song
- printCurrentlyPlaying(channel);
+ printCurrentlyPlaying(channel, false);
+ } else if(enumCommand == Commands.status) {
+ // Print currently playing song with extra info
+ printCurrentlyPlaying(channel, true);
}else if(enumCommand == Commands.summon){
connectToUserVoiceChannel(monitoredGuild.getAudioManager(), event.getMember().getEffectiveName());
}else if(enumCommand == Commands.help){
@@ -253,11 +256,29 @@ public class BotListener extends ListenerAdapter{
channel.sendMessage("Unpaused playback.").queue();
}
- private void printCurrentlyPlaying(final MessageChannel channel){
+ /**
+ * Prints out information about what is currently playing and possibly information about the track and/or the audio volume
+ * @param channel The channel to respond on
+ * @param printStatus Print out extra information such as track information and/or audio volume
+ */
+ private void printCurrentlyPlaying(final MessageChannel channel, boolean printStatus){
GuildMusicManager musicManager = getGuildAudioPlayer();
AudioTrack currentlyPlaying = musicManager.player.getPlayingTrack();
- channel.sendMessage("Currently Playing: " + currentlyPlaying.getInfo().title + " by " + currentlyPlaying.getInfo().author).queue();
-
+ String message = "";
+ if(currentlyPlaying != null) {
+ message = "Currently Playing: " + currentlyPlaying.getInfo().title + " by " + currentlyPlaying.getInfo().author;
+ if(printStatus) {
+ message += ( "\nTime : " + musicManager.player.getPlayingTrack().getPosition() + " | " + musicManager.player.getPlayingTrack().getDuration()
+ + "\nPaused = " + musicManager.player.isPaused()
+ + "\nVolume = " + musicManager.player.getVolume() + "%");
+ }
+ } else {
+ message = "Nothing currently playing";
+ if(printStatus) {
+ message += ("\nVolume = " + musicManager.player.getVolume() + "%");
+ }
+ }
+ channel.sendMessage(message).queue();
}
private void loadAndPlay(final MessageChannel channel, final String trackUrl, boolean preempt) {
diff --git a/src/main/java/soundchan/BotListener/Commands.java b/src/main/java/soundchan/BotListener/Commands.java
index e054de1..046bcab 100644
--- a/src/main/java/soundchan/BotListener/Commands.java
+++ b/src/main/java/soundchan/BotListener/Commands.java
@@ -11,6 +11,7 @@ public enum Commands {
skip,
list,
playingnow,
+ status,
summon,
help
}