Skip to content

Commit c7f7d04

Browse files
committed
优化 moegoe regex
1 parent e4ec7ea commit c7f7d04

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugin/moegoe/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func init() {
3030
"- 让[宁宁|爱瑠|芳乃|茉子|丛雨|小春|七海]说(日语)\n" +
3131
"- 让[수아|미미르|아린|연화|유화|선배]说(韩语)",
3232
}).ApplySingle(ctxext.DefaultSingle)
33-
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).
33+
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).
3434
Handle(func(ctx *zero.Ctx) {
3535
text := ctx.State["regex_matched"].([]string)[2]
3636
id := speakers[ctx.State["regex_matched"].([]string)[1]]
3737
ctx.SendChain(message.Record(fmt.Sprintf(jpapi, url.QueryEscape(text), id)))
3838
})
39-
en.OnRegex("^让(수아|미미르|아린|연화|유화|선배)说([A-Za-z\\s\\d\u3131-\u3163\uac00-\ud7ff]+)$").Limit(ctxext.LimitByGroup).SetBlock(true).
39+
en.OnRegex("^让(수아|미미르|아린|연화|유화|선배)说([A-Za-z\\s\\d\u3131-\u3163\uac00-\ud7ff.。,,、::;;]+)$").Limit(ctxext.LimitByGroup).SetBlock(true).
4040
Handle(func(ctx *zero.Ctx) {
4141
text := ctx.State["regex_matched"].([]string)[2]
4242
id := speakers[ctx.State["regex_matched"].([]string)[1]]

0 commit comments

Comments
 (0)