From f3c02a425486c3dc2a552b1f569dd5cd01803adf Mon Sep 17 00:00:00 2001 From: spiral Date: Tue, 14 Jun 2022 15:55:08 -0400 Subject: [PATCH] feat(bot): remove deprecated commands --- PluralKit.Bot/CommandSystem/Context/Context.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PluralKit.Bot/CommandSystem/Context/Context.cs b/PluralKit.Bot/CommandSystem/Context/Context.cs index d1233467..637700d4 100644 --- a/PluralKit.Bot/CommandSystem/Context/Context.cs +++ b/PluralKit.Bot/CommandSystem/Context/Context.cs @@ -110,6 +110,12 @@ public class Context { _currentCommand = commandDef; + if (deprecated && commandDef != null) + { + await Reply($"{Emojis.Warn} This command has been removed. please use `pk;{commandDef.Key}` instead."); + return; + } + try { using (_metrics.Measure.Timer.Time(BotMetrics.CommandTime, new MetricTags("Command", commandDef?.Key ?? "null"))) @@ -130,9 +136,6 @@ public class Context // Got a complaint the old error was a bit too patronizing. Hopefully this is better? await Reply($"{Emojis.Error} Operation timed out, sorry. Try again, perhaps?"); } - - if (deprecated && commandDef != null) - await Reply($"{Emojis.Warn} This command is deprecated and will be removed soon. In the future, please use `pk;{commandDef.Key}`."); } ///