From fcb13c19a169df4141bf6ba8aea664f410afad71 Mon Sep 17 00:00:00 2001 From: fumiama Date: Sun, 31 Oct 2021 19:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E7=BE=A4=E7=AE=A1=E8=87=AA?= =?UTF-8?q?=E9=97=AD=E5=A2=9E=E5=8A=A0=E5=8C=B9=E9=85=8D=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_manager/manager.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin_manager/manager.go b/plugin_manager/manager.go index bfb4dbb4..a92f9a9d 100644 --- a/plugin_manager/manager.go +++ b/plugin_manager/manager.go @@ -173,18 +173,18 @@ func init() { // 插件主体 ctx.SendChain(message.Text("小黑屋释放成功~")) }) // 自闭禁言 - zero.OnRegex(`^我要自闭.*?(\d+)(.*)`, zero.OnlyGroup).SetBlock(true).SetPriority(40). + zero.OnRegex(`^(我要自闭|禅定).*?(\d+)(.*)`, zero.OnlyGroup).SetBlock(true).SetPriority(40). Handle(func(ctx *zero.Ctx) { - duration := strToInt(ctx.State["regex_matched"].([]string)[1]) - switch ctx.State["regex_matched"].([]string)[2] { - case "分钟": - // - case "小时": + duration := strToInt(ctx.State["regex_matched"].([]string)[2]) + switch ctx.State["regex_matched"].([]string)[3] { + case "分钟", "min", "mins", "m": + break + case "小时", "hour", "hours", "h": duration *= 60 - case "天": + case "天", "day", "days", "d": duration *= 60 * 24 default: - // + break } if duration >= 43200 { duration = 43199 // qq禁言最大时长为一个月