Search in sources :

Example 1 with QueueWidget

use of net.robinfriedli.aiode.command.widget.widgets.QueueWidget in project aiode by robinfriedli.

the class QueueCommand method listQueue.

private void listQueue() {
    Guild guild = getContext().getGuild();
    AudioManager audioManager = Aiode.get().getAudioManager();
    AudioPlayback playback = audioManager.getPlaybackForGuild(guild);
    AudioQueue audioQueue = playback.getAudioQueue();
    CompletableFuture<Message> futureMessage = sendMessage(audioQueue.buildMessageEmbed(playback, guild));
    WidgetRegistry widgetRegistry = getContext().getGuildContext().getWidgetRegistry();
    CompletableFutures.thenAccept(futureMessage, message -> new QueueWidget(widgetRegistry, guild, message, playback).initialise());
}
Also used : AudioManager(net.robinfriedli.aiode.audio.AudioManager) AudioPlayback(net.robinfriedli.aiode.audio.AudioPlayback) Message(net.dv8tion.jda.api.entities.Message) WidgetRegistry(net.robinfriedli.aiode.command.widget.WidgetRegistry) Guild(net.dv8tion.jda.api.entities.Guild) AudioQueue(net.robinfriedli.aiode.audio.AudioQueue) QueueWidget(net.robinfriedli.aiode.command.widget.widgets.QueueWidget)

Aggregations

Guild (net.dv8tion.jda.api.entities.Guild)1 Message (net.dv8tion.jda.api.entities.Message)1 AudioManager (net.robinfriedli.aiode.audio.AudioManager)1 AudioPlayback (net.robinfriedli.aiode.audio.AudioPlayback)1 AudioQueue (net.robinfriedli.aiode.audio.AudioQueue)1 WidgetRegistry (net.robinfriedli.aiode.command.widget.WidgetRegistry)1 QueueWidget (net.robinfriedli.aiode.command.widget.widgets.QueueWidget)1