feat: implement system pronouns commands

This commit is contained in:
dusk 2025-04-01 16:33:00 +09:00
parent 4cc729c93c
commit ae2703f5d9
No known key found for this signature in database
4 changed files with 64 additions and 46 deletions

View file

@ -15,17 +15,17 @@ namespace PluralKit.Bot;
public static class ContextUtils
{
public static async Task<bool> ConfirmClear(this Context ctx, string toClear)
public static async Task<bool> ConfirmClear(this Context ctx, string toClear, bool? confirmYes = null)
{
if (!await ctx.PromptYesNo($"{Emojis.Warn} Are you sure you want to clear {toClear}?", "Clear"))
if (!await ctx.PromptYesNo($"{Emojis.Warn} Are you sure you want to clear {toClear}?", "Clear", null, true, confirmYes))
throw Errors.GenericCancelled();
return true;
}
public static async Task<bool> PromptYesNo(this Context ctx, string msgString, string acceptButton,
User user = null, bool matchFlag = true)
User user = null, bool matchFlag = true, bool? flagValue = null)
{
if (matchFlag && ctx.MatchFlag("y", "yes")) return true;
if (matchFlag && (flagValue ?? ctx.MatchFlag("y", "yes"))) return true;
var prompt = new YesNoPrompt(ctx)
{