🐛 moegoe Chinese

This commit is contained in:
fumiama 2022-08-20 09:26:15 +08:00
parent 52a7977461
commit dd3ccf1d2f

View File

@ -16,7 +16,7 @@ import (
const (
jpapi = "https://moegoe.azurewebsites.net/api/speak?text=%s&id=%d"
krapi = "https://moegoe.azurewebsites.net/api/speakkr?text=%s&id=%d"
cnapi = "http://233366.proxy.nscc-gz.cn:8888?speaker=%s&text=%d"
cnapi = "http://233366.proxy.nscc-gz.cn:8888?speaker=%s&text=%s"
)
var speakers = map[string]uint{
@ -46,8 +46,8 @@ func init() {
})
en.OnRegex("^让(派蒙|凯亚|安柏|丽莎|琴|香菱|枫原万叶|迪卢克|温迪|可莉|早柚|托马|芭芭拉|优菈|云堇|钟离|魈|凝光|雷电将军|北斗|甘雨|七七|刻晴|神里绫华|雷泽|神里绫人|罗莎莉亚|阿贝多|八重神子|宵宫|荒泷一斗|九条裟罗|夜兰|珊瑚宫心海|五郎|达达利亚|莫娜|班尼特|申鹤|行秋|烟绯|久岐忍|辛焱|砂糖|胡桃|重云|菲谢尔|诺艾尔|迪奥娜|鹿野院平藏)说([A-Za-z\\s\\d\u3131-\u3163\uac00-\ud7ff.。,,、:;!?]+)$").Limit(ctxext.LimitByGroup).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
speaker := ctx.State["regex_matched"].([]string)[1]
text := ctx.State["regex_matched"].([]string)[2]
id := ctx.State["regex_matched"].([]string)[1]
ctx.SendChain(message.Record(fmt.Sprintf(cnapi, url.QueryEscape(text), id)))
ctx.SendChain(message.Record(fmt.Sprintf(cnapi, url.QueryEscape(speaker), url.QueryEscape(text))))
})
}