diff --git a/plugin_b14/main.go b/plugin_b14/main.go index fe60cab2ab..24475efc0d 100644 --- a/plugin_b14/main.go +++ b/plugin_b14/main.go @@ -20,7 +20,7 @@ func init() { Help: "base16384加解密\n" + "- 加密xxx\n- 解密xxx\n- 用yyy加密xxx\n- 用yyy解密xxx", }) - en.OnRegex(`^加密(.*)`).SetBlock(true). + en.OnRegex(`^加密\s?(.*)`).SetBlock(true). Handle(func(ctx *zero.Ctx) { str := ctx.State["regex_matched"].([]string)[1] es, err := base14.UTF16be2utf8(base14.EncodeString(str)) @@ -30,7 +30,7 @@ func init() { ctx.SendChain(message.Text("加密失败!")) } }) - en.OnRegex("^解密([\u4e00-\u8e00]*[\u3d01-\u3d06]?)$").SetBlock(true). + en.OnRegex(`^解密\s?([一-踀]*[㴁-㴆]?)$`).SetBlock(true). Handle(func(ctx *zero.Ctx) { str := ctx.State["regex_matched"].([]string)[1] es, err := base14.UTF82utf16be(helper.StringToBytes(str)) @@ -40,7 +40,7 @@ func init() { ctx.SendChain(message.Text("解密失败!")) } }) - en.OnRegex(`^用(.*)加密(.*)`).SetBlock(true). + en.OnRegex(`^用(.*)加密\s?(.*)`).SetBlock(true). Handle(func(ctx *zero.Ctx) { key, str := ctx.State["regex_matched"].([]string)[1], ctx.State["regex_matched"].([]string)[2] t := getea(key) @@ -51,7 +51,7 @@ func init() { ctx.SendChain(message.Text("加密失败!")) } }) - en.OnRegex("^用(.*)解密([\u4e00-\u8e00]*[\u3d01-\u3d06]?)$").SetBlock(true). + en.OnRegex(`^用(.*)解密\s?([一-踀]*[㴁-㴆]?)$`).SetBlock(true). Handle(func(ctx *zero.Ctx) { key, str := ctx.State["regex_matched"].([]string)[1], ctx.State["regex_matched"].([]string)[2] t := getea(key) diff --git a/plugin_bilibili_push/bilibili_push.go b/plugin_bilibili_push/bilibili_push.go index 233211afe0..b985cdae30 100644 --- a/plugin_bilibili_push/bilibili_push.go +++ b/plugin_bilibili_push/bilibili_push.go @@ -67,7 +67,7 @@ func init() { "- 推送列表", }) - en.OnRegex(`^添加订阅(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { + en.OnRegex(`^添加订阅\s?(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { buid, _ := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64) var name string var ok bool @@ -93,7 +93,7 @@ func init() { ctx.SendChain(message.Text("已添加" + name + "的订阅")) } }) - en.OnRegex(`^取消订阅(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { + en.OnRegex(`^取消订阅\s?(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { buid, _ := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64) var name string var ok bool @@ -119,7 +119,7 @@ func init() { ctx.SendChain(message.Text("已取消" + name + "的订阅")) } }) - en.OnRegex(`^取消动态订阅(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { + en.OnRegex(`^取消动态订阅\s?(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { buid, _ := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64) var name string var ok bool @@ -145,7 +145,7 @@ func init() { ctx.SendChain(message.Text("已取消" + name + "的动态订阅")) } }) - en.OnRegex(`^取消直播订阅(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { + en.OnRegex(`^取消直播订阅\s?(\d+)$`, ctxext.UserOrGrpAdmin).SetBlock(true).Handle(func(ctx *zero.Ctx) { buid, _ := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64) var name string var ok bool diff --git a/plugin_cangtoushi/cangtoushi.go b/plugin_cangtoushi/cangtoushi.go index ab28330d1e..bd4334886f 100644 --- a/plugin_cangtoushi/cangtoushi.go +++ b/plugin_cangtoushi/cangtoushi.go @@ -37,7 +37,7 @@ func init() { Help: "藏头诗\n" + "- 藏头诗[xxx]\n- 藏尾诗[xxx]", }) - engine.OnRegex("藏头诗([\u4E00-\u9FA5]{3,10})").SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`藏头诗\s?([一-龥]{3,10})$`).SetBlock(true).Handle(func(ctx *zero.Ctx) { kw := ctx.State["regex_matched"].([]string)[1] login() data, err := search(kw, "7", "0") @@ -48,7 +48,7 @@ func init() { ctx.SendChain(message.Text(text)) }) - engine.OnRegex("藏尾诗([\u4E00-\u9FA5]{3,10})").SetBlock(true).Handle(func(ctx *zero.Ctx) { + engine.OnRegex(`藏尾诗\s?([一-龥]{3,10})$`).SetBlock(true).Handle(func(ctx *zero.Ctx) { kw := ctx.State["regex_matched"].([]string)[1] login() data, err := search(kw, "7", "2") diff --git a/plugin_fortune/fortune.go b/plugin_fortune/fortune.go index cddf14d849..3e2b652648 100644 --- a/plugin_fortune/fortune.go +++ b/plugin_fortune/fortune.go @@ -82,7 +82,7 @@ func init() { "- 运势 | 抽签\n" + "- 设置底图[车万 | DC4 | 爱因斯坦 | 星空列车 | 樱云之恋 | 富婆妹 | 李清歌 | 公主连结 | 原神 | 明日方舟 | 碧蓝航线 | 碧蓝幻想 | 战双 | 阴阳师 | 赛马娘]", }) - en.OnRegex(`^设置底图(.*)`).SetBlock(true). + en.OnRegex(`^设置底图\s?(.*)`).SetBlock(true). Handle(func(ctx *zero.Ctx) { gid := ctx.Event.GroupID if gid <= 0 {