mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
Confirm before clearing (most) entity properties
This commit is contained in:
parent
969065724d
commit
dfacbc51ab
7 changed files with 32 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -60,8 +60,13 @@ namespace PluralKit.Bot
|
|||
return potentialMatches.Any(potentialMatch => flags.Contains(potentialMatch));
|
||||
}
|
||||
|
||||
public static bool MatchClear(this Context ctx) =>
|
||||
ctx.Match("clear", "reset") || ctx.MatchFlag("c", "clear");
|
||||
public static async Task<bool> MatchClear(this Context ctx, string toClear = null)
|
||||
{
|
||||
var matched = ctx.Match("clear", "reset") || ctx.MatchFlag("c", "clear");
|
||||
Console.WriteLine(toClear);
|
||||
if (matched && toClear != null) return await ctx.ConfirmClear(toClear);
|
||||
else return matched;
|
||||
}
|
||||
|
||||
public static async Task<List<PKMember>> ParseMemberList(this Context ctx, SystemId? restrictToSystem)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue