コード例 #1
0
        public async Task QueueAsync()
        {
            var    audioQueue = AudioQueues.GetAudioQueue(Context.Guild);
            string avatar     = Context.Message.Author.GetAvatarUrl() ?? Context.Message.Author.GetDefaultAvatarUrl();

            if (audioQueue.Queue.ElementAtOrDefault(0) == null)
            {
                EmbedBuilder builderNull = new EmbedBuilder();
                builderNull
                .WithAuthor(Context.Message.Author.Username, avatar)
                .WithDescription("\n Kolejka jest pusta")
                .WithColor(Color.DarkRed);

                await ReplyAsync("", false, builderNull.Build());

                return;
            }

            List <string>         queue        = new List <string>();
            List <List <string> > pagesContent = new List <List <string> >(5);

            queue        = AudioQueuesManagment.CreateListOfSongs(Context.Channel, audioQueue.Queue, Context.Message.Author.Username, avatar);
            pagesContent = AudioQueuesManagment.CreateListOfPages(queue);
            string[] pages = new string[5];
            pages = AudioQueuesManagment.AssignContentToPages(pages, pagesContent);

            await PagedReplyAsync(pages);
        }
コード例 #2
0
 public static async Task SkipAsync(SocketGuild guild)
 {
     LavalinkPlayer player = lavalinkManager.GetPlayer(guild.Id);
     await AudioQueuesManagment.RemoveAndPlay(player, player.CurrentTrack);
 }