public async Task RemoveUserPrefix(CommandContext ctx, string prefix, string global = null) { if (global != null && global?.StartsWith("g") != true) { return; } var p = await PrefixDB.GetAllUserPrefixes(ctx.User.Id); var gld = ctx.Guild.Id; if (global != null) { gld = 0; if (!p[0].Any(x => x == prefix)) { await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Prefix").WithDescription("**Error** You already have this as global prefix").Build()); return; } } else { if (!p[ctx.Guild.Id].Any(x => x == prefix)) { await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Prefix").WithDescription($"**Error** You already have {prefix} as prefix for this guild!").Build()); return; } } await PrefixDB.RemoveUserPrefix(ctx.User.Id, gld, prefix); if (gld == 0) { await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Prefix").WithDescription($"Removed personal global prefix: {prefix}").Build()); } else { await ctx.RespondAsync(embed : new DiscordEmbedBuilder().WithTitle("Remove Prefix").WithDescription($"Removed personal guild prefix: {prefix}").Build()); } }
public async Task ListPrefixes(CommandContext ctx) { var gld = await PrefixDB.GetGuildPrefixes(ctx.Guild.Id); var usr = await PrefixDB.GetAllUserPrefixes(ctx.User.Id); }