🐛 moegoe regex

This commit is contained in:
fumiama 2022-08-14 20:45:53 +08:00
parent 4bf734778b
commit e4ec7ea5bb

View File

@ -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]]