From 599f0fbc54b878d4eca0ca038d3dce98e10a01f0 Mon Sep 17 00:00:00 2001 From: rladenson <78043712+rladenson@users.noreply.github.com> Date: Mon, 17 Jul 2023 16:51:51 -0600 Subject: [PATCH] feat(bot): added "pk;s fh clear" as alias to "pk;sw delete all" (#567) --- PluralKit.Bot/Commands/Switch.cs | 2 +- PluralKit.Bot/Commands/SystemFront.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/Switch.cs b/PluralKit.Bot/Commands/Switch.cs index 347bfe29..9272d911 100644 --- a/PluralKit.Bot/Commands/Switch.cs +++ b/PluralKit.Bot/Commands/Switch.cs @@ -163,7 +163,7 @@ public class Switch { ctx.CheckSystem(); - if (ctx.Match("all", "clear") || ctx.MatchFlag("all", "clear")) + if (ctx.Match("all", "clear") || ctx.MatchFlag("all", "clear", "c")) { // Subcommand: "delete all" var purgeMsg = diff --git a/PluralKit.Bot/Commands/SystemFront.cs b/PluralKit.Bot/Commands/SystemFront.cs index e4c7d222..fa687556 100644 --- a/PluralKit.Bot/Commands/SystemFront.cs +++ b/PluralKit.Bot/Commands/SystemFront.cs @@ -28,6 +28,12 @@ public class SystemFront public async Task SystemFrontHistory(Context ctx, PKSystem system) { + if (ctx.MatchFlag("clear", "c") || ctx.PeekArgument() == "clear") + { + await new Switch().SwitchDelete(ctx); + return; + } + if (system == null) throw Errors.NoSystemError; ctx.CheckSystemPrivacy(system.Id, system.FrontHistoryPrivacy);