Exemplo n.º 1
0
        public async Task Remove(CommandContext ctx, int pos, [RemainingText] string pl = null)
        {
            if (pl == null)
            {
                pl = await SelectPL(ctx);

                if (pl == null)
                {
                    return;
                }
            }
            pos = pos - 1;
            var p = await PlaylistDB.GetPlaylistsSimple(ctx.Member.Id);

            if (!p.Any(x => x == pl))
            {
                await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Song").WithDescription("**Error** You dont have a playlist with that name!").Build());

                return;
            }
            var ents = await PlaylistDB.GetPlaylist(ctx.Member.Id, pl);

            var en = await ents.GetEntries();

            await PlaylistDB.RemoveFromList(pos, pl, ctx.Member.Id);

            await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Song").WithDescription($"Entry removed! -> {en[pos].track.Title}").Build());
        }