mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 16:20:13 +00:00
remove rest of the parsing in csharp bot
This commit is contained in:
parent
15ffd16c01
commit
479e0a59b5
35 changed files with 242 additions and 409 deletions
|
|
@ -16,17 +16,17 @@ namespace PluralKit.Bot;
|
|||
|
||||
public static class ContextUtils
|
||||
{
|
||||
public static async Task<bool> ConfirmClear(this Context ctx, string toClear, bool? confirmYes = null)
|
||||
public static async Task<bool> ConfirmClear(this Context ctx, string toClear, bool confirmYes)
|
||||
{
|
||||
if (!await ctx.PromptYesNo($"{Emojis.Warn} Are you sure you want to clear {toClear}?", "Clear", null, true, confirmYes))
|
||||
if (!await ctx.PromptYesNo($"{Emojis.Warn} Are you sure you want to clear {toClear}?", "Clear", flagValue: 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, bool? flagValue = null)
|
||||
User user = null, bool matchFlag = true, bool flagValue = false)
|
||||
{
|
||||
if (matchFlag && (flagValue ?? ctx.MatchFlag("y", "yes"))) return true;
|
||||
if (matchFlag && flagValue) return true;
|
||||
|
||||
var prompt = new YesNoPrompt(ctx)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue