diff --git a/PluralKit.Bot/Commands/MemberEdit.cs b/PluralKit.Bot/Commands/MemberEdit.cs index 8038bdb9..dbfa4bc1 100644 --- a/PluralKit.Bot/Commands/MemberEdit.cs +++ b/PluralKit.Bot/Commands/MemberEdit.cs @@ -61,12 +61,9 @@ namespace PluralKit.Bot { if (target.System != ctx.System?.Id) throw Errors.NotOwnMemberError; } - - private static bool MatchClear(Context ctx) => - ctx.Match("clear") || ctx.MatchFlag("c", "clear"); public async Task Description(Context ctx, PKMember target) { - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); @@ -109,7 +106,7 @@ namespace PluralKit.Bot } public async Task Pronouns(Context ctx, PKMember target) { - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); var patch = new MemberPatch {Pronouns = Partial.Null()}; @@ -147,7 +144,7 @@ namespace PluralKit.Bot public async Task Color(Context ctx, PKMember target) { var color = ctx.RemainderOrNull(); - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); @@ -195,7 +192,7 @@ namespace PluralKit.Bot } public async Task Birthday(Context ctx, PKMember target) { - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); @@ -281,7 +278,7 @@ namespace PluralKit.Bot await ctx.Reply(successStr); } - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); @@ -315,7 +312,7 @@ namespace PluralKit.Bot { ctx.CheckGuildContext(); - if (MatchClear(ctx)) + if (ctx.MatchClear()) { CheckEditMemberPermission(ctx, target); diff --git a/PluralKit.Bot/Commands/MemberProxy.cs b/PluralKit.Bot/Commands/MemberProxy.cs index 8265a34c..216697c4 100644 --- a/PluralKit.Bot/Commands/MemberProxy.cs +++ b/PluralKit.Bot/Commands/MemberProxy.cs @@ -45,7 +45,7 @@ namespace PluralKit.Bot } // "Sub"command: clear flag - if (ctx.Match("clear", "purge", "clean", "removeall") || ctx.MatchFlag("c", "clear")) + if (ctx.MatchClear()) { // If we already have multiple tags, this would clear everything, so prompt that if (target.ProxyTags.Count > 1) diff --git a/PluralKit.Bot/Commands/SystemEdit.cs b/PluralKit.Bot/Commands/SystemEdit.cs index 965bcc87..b4d579cb 100644 --- a/PluralKit.Bot/Commands/SystemEdit.cs +++ b/PluralKit.Bot/Commands/SystemEdit.cs @@ -32,7 +32,7 @@ namespace PluralKit.Bot { ctx.CheckSystem(); - if (ctx.MatchFlag("c", "clear") || ctx.Match("clear")) + if (ctx.MatchClear()) { var clearPatch = new SystemPatch {Name = null}; await _db.Execute(conn => conn.UpdateSystem(ctx.System.Id, clearPatch)); @@ -63,7 +63,7 @@ namespace PluralKit.Bot public async Task Description(Context ctx) { ctx.CheckSystem(); - if (ctx.MatchFlag("c", "clear") || ctx.Match("clear")) + if (ctx.MatchClear()) { var patch = new SystemPatch {Description = null}; await _db.Execute(conn => conn.UpdateSystem(ctx.System.Id, patch)); @@ -101,7 +101,7 @@ namespace PluralKit.Bot { ctx.CheckSystem(); - if (ctx.MatchFlag("c", "clear") || ctx.Match("clear")) + if (ctx.MatchClear()) { var patch = new SystemPatch {Tag = null}; await _db.Execute(conn => conn.UpdateSystem(ctx.System.Id, patch)); @@ -226,7 +226,7 @@ namespace PluralKit.Bot { if (ctx.System == null) throw Errors.NoSystemError; - if (ctx.MatchFlag("c", "clear") || ctx.Match("clear")) + if (ctx.MatchClear()) { var clearPatch = new SystemPatch {UiTz = "UTC"}; await _db.Execute(conn => conn.UpdateSystem(ctx.System.Id, clearPatch));