refactor(bot): separate MatchClear from ConfirmClear

This commit is contained in:
spiral
2022-12-01 07:16:36 +00:00
parent f06fdb38ef
commit f9abcc68c4
9 changed files with 28 additions and 36 deletions

View File

@@ -173,7 +173,7 @@ public class Config
Duration? newTimeout;
Duration overflow = Duration.Zero;
if (ctx.Match("off", "stop", "cancel", "no", "disable", "remove")) newTimeout = Duration.Zero;
else if (await ctx.MatchClear()) newTimeout = null;
else if (ctx.MatchClear()) newTimeout = null;
else
{
var timeoutStr = ctx.RemainderOrNull();
@@ -204,7 +204,7 @@ public class Config
{
if (ctx.System == null) throw Errors.NoSystemError;
if (await ctx.MatchClear())
if (ctx.MatchClear())
{
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { UiTz = "UTC" });