Ejemplo n.º 1
0
        public async void ListSongs(IMessageChannel channel, int page)
        {
            //Page enumeration works like an array, so pages actually start from 0,
            int arrayPage = page - 1;

            int pageRepresentation = page;
            int pageCount          = (ListSize() + 10 - 1) / 10;

            if (SongList.Count < 1)
            {
                var embedL = new EmbedBuilder()
                             .WithColor(new Color(240, 230, 231))
                             .WithDescription("Nenhuma musica na lista");
                await channel.SendMessageAsync("", false, embedL);

                return;
            }
            else if (ListSize() <= arrayPage * 10)
            {
                var embedL = new EmbedBuilder()
                             .WithColor(new Color(240, 230, 231))
                             .WithDescription("Não é possível exibir a " + page + "ª pagina pois não há musicas suficientes");
                await channel.SendMessageAsync("", false, embedL);

                return;
            }



            var embedList = new EmbedBuilder()
                            .WithColor(new Color(240, 230, 231))
                            .WithFooter(new EmbedFooterBuilder().WithText("Pagina " + pageRepresentation + "/" + pageCount));

            //10 Songs per page
            var i = arrayPage * 10;


            while (i < SongList.Count && i < ((arrayPage * 10) + 10))
            {
                EmbedFieldBuilder embedField = new EmbedFieldBuilder();

                YTSong cur = SongList[i];

                if (SongList[i] == SongList[CurrentSongID])
                {
                    embedField.WithName("`#" + (i + 1) + " - Atual `")
                    .WithIsInline(false)
                    .WithValue("[" + cur.Title + "](" + cur.Url + ")\n\n`" + cur.RequestAuthor.Username + " | " + cur.Duration + "`");
                }
                else
                {
                    embedField.WithName("`#" + (i + 1) + "`")
                    .WithIsInline(false)
                    .WithValue("[" + cur.Title + "](" + cur.Url + ")\n\n`" + cur.RequestAuthor.Username + " | " + cur.Duration + "`");
                }
                embedList.AddField(embedField);
                i++;
            }
            await MessageChannel.SendMessageAsync("", false, embedList);
        }
Ejemplo n.º 2
0
        public async void ShowSongSkippedEmbed(SocketUser usr)
        {
            if (CurrentSong() == null)
            {
                return;
            }

            DeleteCurMessage();

            YTSong curSong = CurrentSong();

            EmbedFieldBuilder songTitle = new EmbedFieldBuilder();

            songTitle.WithName("--")
            .WithIsInline(false)
            .WithValue("`Cortesia de " + usr.Username + "`");

            var embedSkip = new EmbedBuilder()
                            .WithColor(new Color(240, 230, 231))
                            .WithAuthor(author => { author.WithName(" Pulando musiquinha lixo").WithIconUrl("https://cdn.discordapp.com/avatars/390402848443203595/d2831182eb4d3177febd28f44b4ec936.png?size=256"); })
                            .WithThumbnailUrl(curSong.DefaultThumbnailUrl);


            embedSkip.AddField(songTitle);

            var msg = await MessageChannel.SendMessageAsync("", false, embedSkip);

            await Task.Delay(12000);

            await msg.DeleteAsync();
        }
Ejemplo n.º 3
0
        public async void ShowSongSkippedEmbed(int n)
        {
            if (CurrentSong() == null)
            {
                return;
            }

            DeleteCurMessage();

            YTSong curSong = CurrentSong();

            EmbedFieldBuilder songTitle = new EmbedFieldBuilder();

            songTitle.WithName("** " + (PreviousSongID + 1) + " # --> " + (curSong.Order + 1) + " #**")
            .WithIsInline(false)
            .WithValue("`" + "¯\\_(ツ)_/¯" + "`");

            var embedSkip = new EmbedBuilder()
                            .WithColor(new Color(240, 230, 231))
                            .WithAuthor(author => { author.WithName("Pulando " + n + " músicas").WithIconUrl("https://cdn.discordapp.com/avatars/390402848443203595/d2831182eb4d3177febd28f44b4ec936.png?size=256"); })
                            .WithThumbnailUrl(curSong.DefaultThumbnailUrl);

            embedSkip.AddField(songTitle);

            var msg = await MessageChannel.SendMessageAsync("", false, embedSkip);

            await Task.Delay(12000);

            await msg.DeleteAsync();
        }
Ejemplo n.º 4
0
        public async void ListSongs(IMessageChannel channel)
        {
            if (SongList.Count < 1)
            {
                var embedL = new EmbedBuilder()
                             .WithColor(new Color(240, 230, 231))
                             .WithDescription("Nenhuma musica na lista");
                await channel.SendMessageAsync("", false, embedL);

                return;
            }

            var i = 0;

            int pageCount = (ListSize() + 10 - 1) / 10;


            var embedList = new EmbedBuilder()
                            .WithColor(new Color(240, 230, 231))
                            .WithFooter(new EmbedFooterBuilder().WithText("Pagina 1/" + pageCount));

            //Will only show the first page, each page contains 10 songs
            while (i < SongList.Count && i < 10)
            {
                EmbedFieldBuilder embedField = new EmbedFieldBuilder();

                YTSong cur = SongList[i];

                if (SongList[i] == SongList[CurrentSongID])
                {
                    embedField.WithName("`#" + (i + 1) + " - Atual `")
                    .WithIsInline(false)
                    .WithValue("[" + cur.Title + "](" + cur.Url + ")\n\n`" + cur.RequestAuthor.Username + " | " + cur.Duration + "`");
                }
                else
                {
                    embedField.WithName("`#" + (i + 1) + "`")
                    .WithIsInline(false)
                    .WithValue("[" + cur.Title + "](" + cur.Url + ")\n\n`" + cur.RequestAuthor.Username + " | " + cur.Duration + "`");
                }
                embedList.AddField(embedField);
                i++;
            }
            await MessageChannel.SendMessageAsync("", false, embedList);
        }
Ejemplo n.º 5
0
        public async void PlaybackEndEmbed()
        {
            EmbedFieldBuilder songTitle = new EmbedFieldBuilder();

            songTitle.WithName("** Fim da reprodução **")
            .WithIsInline(false)
            .WithValue("`" + "--" + "`");

            var embedSkip = new EmbedBuilder()
                            .WithColor(new Color(240, 230, 231))
                            .WithAuthor(author => { author.WithName("♪ ♪").WithIconUrl("https://cdn.discordapp.com/avatars/390402848443203595/d2831182eb4d3177febd28f44b4ec936.png?size=256"); });

            embedSkip.AddField(songTitle);

            var msg = await MessageChannel.SendMessageAsync("", false, embedSkip);

            await Task.Delay(15000);

            await msg.DeleteAsync();
        }
Ejemplo n.º 6
0
        public async void ShowSongEndedEmbed()
        {
            if (CurrentSong() == null)
            {
                return;
            }

            DeleteCurMessage();

            YTSong curSong = CurrentSong();

            if (curSong == null)
            {
                return;
            }

            EmbedFieldBuilder songTitle = new EmbedFieldBuilder();

            songTitle.WithName("** " + curSong.Order + " # **")
            .WithIsInline(false)
            .WithValue("[" + curSong.Title + "](" + curSong.Url + ")" +
                       "\n\n`" + curSong.RequestAuthor.Username + " | " + curSong.Duration + "`");

            var embedEnd = new EmbedBuilder()
                           .WithColor(new Color(240, 230, 231))
                           .WithAuthor(author => { author.WithName(" Fim.").WithIconUrl("https://cdn.discordapp.com/avatars/390402848443203595/d2831182eb4d3177febd28f44b4ec936.png?size=256"); })
                           .WithThumbnailUrl(curSong.DefaultThumbnailUrl);

            embedEnd.AddField(songTitle);

            var msg = await MessageChannel.SendMessageAsync("", false, embedEnd);

            await Task.Delay(10000);

            await msg.DeleteAsync();
        }