feat(bot): update deprecated command warning for pk;serverconfig

This commit is contained in:
alyssa 2024-11-12 05:20:39 +09:00
parent 17f094354d
commit a0b528d4af
2 changed files with 1 additions and 15 deletions

View file

@ -215,12 +215,6 @@ public partial class CommandTree
else if (ctx.Match("commands", "help"))
await PrintCommandList(ctx, "systems", SystemCommands);
// these are deprecated (and not accessible by other users anyway), let's leave them out of new parsing
else if (ctx.Match("timezone", "tz"))
await ctx.Execute<Config>(ConfigTimezone, m => m.SystemTimezone(ctx), true);
else if (ctx.Match("ping"))
await ctx.Execute<Config>(ConfigPing, m => m.SystemPing(ctx), true);
// todo: these aren't deprecated but also shouldn't be here
else if (ctx.Match("webhook", "hook"))
await ctx.Execute<Api>(null, m => m.SystemWebhook(ctx));
@ -561,13 +555,6 @@ public partial class CommandTree
if (ctx.System == null)
return ctx.Reply($"{Emojis.Error} {Errors.NoSystemError.Message}");
// todo: move this whole block to Autoproxy.cs when these are removed
if (ctx.Match("account", "ac"))
return ctx.Execute<Config>(ConfigAutoproxyAccount, m => m.AutoproxyAccount(ctx), true);
if (ctx.Match("timeout", "tm"))
return ctx.Execute<Config>(ConfigAutoproxyTimeout, m => m.AutoproxyTimeout(ctx), true);
return ctx.Execute<Autoproxy>(AutoproxySet, m => m.SetAutoproxyMode(ctx));
}

View file

@ -115,8 +115,7 @@ public class Context
if (deprecated && commandDef != null)
{
await Reply($"{Emojis.Warn} This command has been removed. please use `pk;{commandDef.Key}` instead.");
return;
await Reply($"{Emojis.Warn} Server configuration has moved to `pk;serverconfig`. The command you are trying to run is now `pk;{commandDef.Key}`.");
}
try