From dd3ccf1d2fb3b657aa4be31431e323c433d76264 Mon Sep 17 00:00:00 2001 From: fumiama <41315874+fumiama@users.noreply.github.com> Date: Sat, 20 Aug 2022 09:26:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20moegoe=20Chinese?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/moegoe/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/moegoe/main.go b/plugin/moegoe/main.go index 63dd52ab..0ee528ff 100644 --- a/plugin/moegoe/main.go +++ b/plugin/moegoe/main.go @@ -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)))) }) }