Queue length

This commit is contained in:
Hax 2020-01-03 18:23:06 +01:00
parent f18c5e7d2b
commit 2b558c00fe
2 changed files with 5 additions and 3 deletions

View file

@ -23,11 +23,13 @@ public class QueueCommand implements Command {
} else {
Set<AudioInfo> queue = event.getAudioManager().getTrackManager(event.getGuild()).getQueuedTracks();
StringBuilder builder = new StringBuilder();
long queuelength = 0;
for (AudioInfo g : queue) {
builder.append("**").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n");
queuelength = queuelength + g.getTrack().getInfo().length;
builder.append("("+event.getAudioManager().getTimestamp(g.getTrack().getInfo().length)+") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n");
}
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
"commands.music.queue.success.title", "",
"commands.music.queue.success.title", "("+String.valueOf(event.getAudioManager().getTimestamp(queuelength))+")",
"commands.music.queue.success.description", builder.toString())
.build()).queue();
}

View file

@ -205,7 +205,7 @@ commands.music.info.error.description = I am not playing anything at the moment
commands.music.info.help.description = Shows information about the playing song.
commands.music.queue.error.title = No queue
commands.music.queue.error.description = There are no queued songs at the moment
commands.music.queue.success.title = Queue
commands.music.queue.success.title = Queue %extra%
commands.music.queue.success.description = This is the queue\: \n %extra%
commands.music.queue.help.description = Shows the music queue.
commands.music.skip.success.title = Successfully skipped