From eabf32eed944a56a954872e8d0d2a3efc5a6584c Mon Sep 17 00:00:00 2001 From: copurxia <53603471+copurxia@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:11:47 +0800 Subject: [PATCH] fix regex error --- plugin/qqwife/favorSystem.go | 2 +- plugin/robbery/robbery.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/qqwife/favorSystem.go b/plugin/qqwife/favorSystem.go index 2f7b780d4f..8c770c10b0 100644 --- a/plugin/qqwife/favorSystem.go +++ b/plugin/qqwife/favorSystem.go @@ -47,7 +47,7 @@ func init() { ) }) // 礼物系统 - engine.OnRegex(`^买礼物给\[CQ:at,(?:\S*,)?qq=(\d+)(?:,\S*)?\]|(\d+)`, getdb).SetBlock(true).Limit(ctxext.LimitByUser). + engine.OnRegex(`^买礼物给\s?(\[CQ:at,(?:\S*,)?qq=(\d+)(?:,\S*)?\]|(\d+))`, getdb).SetBlock(true).Limit(ctxext.LimitByUser). Handle(func(ctx *zero.Ctx) { gid := ctx.Event.GroupID uid := ctx.Event.UserID diff --git a/plugin/robbery/robbery.go b/plugin/robbery/robbery.go index eb85bdd339..4a2c9fbe78 100644 --- a/plugin/robbery/robbery.go +++ b/plugin/robbery/robbery.go @@ -74,7 +74,7 @@ func init() { }) // 打劫功能 - engine.OnRegex(`^打劫\[CQ:at,(?:\S*,)?qq=(\d+)(?:,\S*)?\]|(\d+)`, getdb).SetBlock(true).Limit(ctxext.LimitByUser). + engine.OnRegex(`^打劫\s?(\[CQ:at,(?:\S*,)?qq=(\d+)(?:,\S*)?\]|(\d+))`, getdb).SetBlock(true).Limit(ctxext.LimitByUser). Handle(func(ctx *zero.Ctx) { uid := ctx.Event.UserID fiancee := ctx.State["regex_matched"].([]string)