Queue Command

This commit is contained in:
GregTCLTK 2019-12-28 14:52:52 +01:00
parent d76bd5f338
commit 25b88c1005
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67
2 changed files with 10 additions and 12 deletions

View file

@ -4,7 +4,6 @@ import com.bbn.hadder.audio.AudioInfo;
import com.bbn.hadder.commands.Command;
import com.bbn.hadder.commands.CommandEvent;
import com.bbn.hadder.utils.MessageEditor;
import net.dv8tion.jda.api.EmbedBuilder;
import java.util.Set;
@ -23,14 +22,11 @@ public class QueueCommand implements Command {
).build()).queue();
} else {
Set<AudioInfo> queue = event.getAudioManager().getTrackManager(event.getGuild()).getQueuedTracks();
EmbedBuilder b = event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO,
"commands.music.queue.success.title",
"commands.music.queue.success.description")
.addField("Queued songs", String.valueOf(queue.size()), true);
StringBuilder builder = new StringBuilder();
for (AudioInfo g : queue) {
b.addField(g.getTrack().getInfo().author, g.getTrack().getInfo().title, true);
builder.append("**").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n");
}
event.getTextChannel().sendMessage(b.build()).queue();
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.music.queue.success.title", "", "commands.music.queue.success.description", builder.toString()).build()).queue();
}
}
@ -41,7 +37,7 @@ public class QueueCommand implements Command {
@Override
public String description() {
return "Shows the music queue.";
return "commands.music.queue.help.description";
}
@Override

View file

@ -193,13 +193,14 @@ commands.music.leave.help.description = Leaves a voice channel
commands.music.play.load.title = %extra% Now loading %extra%
commands.music.play.load.description = Trying to load the song...
commands.music.play.success.loading.title = %extra% Now playing %extra%
commands.music.play.success.title = Title
commands.music.play.success.author = Author
commands.music.play.success.length = Length
commands.music.play.success.tracks = Tracks
commands.music.play.error.load.title = %extra% Load failed %extra%
commands.music.play.error.load.description = Unfortunately I can not load the given song.
commands.music.play.error.match.title = %extra% No matches %extra%
commands.music.play.error.match.description = I can not find a song named this on YouTube.
commands.music.play.success.title = Title
commands.music.play.success.author = Author
commands.music.play.success.length = Length
commands.music.play.help.description = Plays a song
commands.music.stop.success.title = Successfully stopped
commands.music.stop.success.description = I successfully stopped the song.
@ -211,7 +212,8 @@ commands.music.stop.help.description = Stops the 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.description = This is the queue\: %extra%
commands.music.queue.success.description = This is the queue\: \n %extra%
commands.music.queue.help.description = Shows the music queue.
commands.nsfw.gif.error.title = GIF not showing? Click here
commands.nsfw.img.error.title = Image not showing? Click here