示例#1
0
        public async Task Delete(CommandContext ctx, [RemainingText] string name = null)
        {
            if (name == null)
            {
                name = await SelectPL(ctx);

                if (name == null)
                {
                    return;
                }
            }
            var pls = await PlaylistDB.GetPlaylistsSimple(ctx.Member.Id);

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

                return;
            }
            await PlaylistDB.RemovePlaylist(name, ctx.Member.Id);

            await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Delete Playlist").WithDescription("Deleted playlist -> " + name).Build());
        }