From c7f7d0409e119f9a291feebb6e8458b6d1e58750 Mon Sep 17 00:00:00 2001 From: fumiama <41315874+fumiama@users.noreply.github.com> Date: Mon, 15 Aug 2022 10:31:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20moegoe=20regex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/moegoe/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/moegoe/main.go b/plugin/moegoe/main.go index 4a5d40a9..0f84c2fd 100644 --- a/plugin/moegoe/main.go +++ b/plugin/moegoe/main.go @@ -30,13 +30,13 @@ func init() { "- 让[宁宁|爱瑠|芳乃|茉子|丛雨|小春|七海]说(日语)\n" + "- 让[수아|미미르|아린|연화|유화|선배]说(韩语)", }).ApplySingle(ctxext.DefaultSingle) - en.OnRegex("^让(宁宁|爱瑠|芳乃|茉子|丛雨|小春|七海)说([A-Za-z\\s\\d\u3005\u3040-\u30ff\u4e00-\u9fff\uff11-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uff9d]+)$").Limit(ctxext.LimitByGroup).SetBlock(true). + en.OnRegex("^让(宁宁|爱瑠|芳乃|茉子|丛雨|小春|七海)说([A-Za-z\\s\\d\u3005\u3040-\u30ff\u4e00-\u9fff\uff11-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uff9d.。,,、::;;]+)$").Limit(ctxext.LimitByGroup).SetBlock(true). Handle(func(ctx *zero.Ctx) { text := ctx.State["regex_matched"].([]string)[2] id := speakers[ctx.State["regex_matched"].([]string)[1]] ctx.SendChain(message.Record(fmt.Sprintf(jpapi, url.QueryEscape(text), id))) }) - en.OnRegex("^让(수아|미미르|아린|연화|유화|선배)说([A-Za-z\\s\\d\u3131-\u3163\uac00-\ud7ff]+)$").Limit(ctxext.LimitByGroup).SetBlock(true). + en.OnRegex("^让(수아|미미르|아린|연화|유화|선배)说([A-Za-z\\s\\d\u3131-\u3163\uac00-\ud7ff.。,,、::;;]+)$").Limit(ctxext.LimitByGroup).SetBlock(true). Handle(func(ctx *zero.Ctx) { text := ctx.State["regex_matched"].([]string)[2] id := speakers[ctx.State["regex_matched"].([]string)[1]]