Queue Command but queue is not working
This commit is contained in:
parent
2552062b9d
commit
ef74e3240b
3 changed files with 17 additions and 4 deletions
|
|
@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class AudioManager {
|
public class AudioManager {
|
||||||
|
|
||||||
|
|
||||||
public AudioManager() {
|
public AudioManager() {
|
||||||
AudioSourceManagers.registerRemoteSources(myManager);
|
AudioSourceManagers.registerRemoteSources(myManager);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bbn.hadder.audio.AudioManager;
|
||||||
import com.bbn.hadder.commands.Command;
|
import com.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import com.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import com.bbn.hadder.utils.MessageEditor;
|
||||||
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
@ -17,11 +18,20 @@ public class QueueCommand implements Command {
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent event) {
|
public void executed(String[] args, CommandEvent event) {
|
||||||
if (!new AudioManager().hasPlayer(event.getGuild()) || new AudioManager().getTrackManager(event.getGuild()).getQueuedTracks().isEmpty()) {
|
if (!new AudioManager().hasPlayer(event.getGuild()) || new AudioManager().getTrackManager(event.getGuild()).getQueuedTracks().isEmpty()) {
|
||||||
event.getTextChannel().sendMessage(
|
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING,
|
||||||
event.getMessageEditor().getMessage(MessageEditor.MessageType.WARNING, "", "").build()).queue();
|
"commands.music.queue.error.title",
|
||||||
|
"commands.music.queue.error.description"
|
||||||
|
).build()).queue();
|
||||||
} else {
|
} else {
|
||||||
Set<AudioInfo> queue = new AudioManager().getTrackManager(event.getGuild()).getQueuedTracks();
|
Set<AudioInfo> queue = new AudioManager().getTrackManager(event.getGuild()).getQueuedTracks();
|
||||||
// Insert message here
|
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);
|
||||||
|
for (AudioInfo g : queue) {
|
||||||
|
b.addField(g.getTrack().getInfo().author, g.getTrack().getInfo().title, true);
|
||||||
|
}
|
||||||
|
event.getTextChannel().sendMessage(b.build()).queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,10 @@ commands.music.play.help.description = Plays a song
|
||||||
commands.music.stop.success.title = Successfully stopped
|
commands.music.stop.success.title = Successfully stopped
|
||||||
commands.music.stop.success.description = I successfully stopped the song.
|
commands.music.stop.success.description = I successfully stopped the song.
|
||||||
commands.music.stop.help.description = Stops the song
|
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.nsfw.gif.error.title = GIF not showing? Click here
|
commands.nsfw.gif.error.title = GIF not showing? Click here
|
||||||
commands.nsfw.img.error.title = Image not showing? Click here
|
commands.nsfw.img.error.title = Image not showing? Click here
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue