From 7e715968b1065f77f9601b29642a26dbaf81d998 Mon Sep 17 00:00:00 2001 From: himawari <1156544355@qq.com> Date: Tue, 23 Apr 2024 13:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=AF=B9=E5=9B=BE=E5=83=8F?= =?UTF-8?q?=E7=9A=84=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aireply/lolimi.go | 3 +++ tts/lolimi/api.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/aireply/lolimi.go b/aireply/lolimi.go index 92b07d9..d80efb5 100644 --- a/aireply/lolimi.go +++ b/aireply/lolimi.go @@ -48,6 +48,9 @@ func (l *LolimiAi) TalkPlain(_ int64, msg, nickname string) string { return "ERROR: " + err.Error() } replystr := gjson.Get(binary.BytesToString(data), "data.output").String() + replystr = strings.ReplaceAll(replystr, "", "\n") + replystr = strings.ReplaceAll(replystr, "\" />", "]") textReply := strings.ReplaceAll(replystr, l.n, nickname) for _, w := range l.b { if strings.Contains(textReply, w) { diff --git a/tts/lolimi/api.go b/tts/lolimi/api.go index 2e53835..03183f5 100644 --- a/tts/lolimi/api.go +++ b/tts/lolimi/api.go @@ -2,6 +2,7 @@ package lolimi import ( "fmt" + "strings" "github.com/FloatTech/floatbox/binary" "github.com/FloatTech/floatbox/web" @@ -43,6 +44,7 @@ func TTS(name string, text string) (recURL string, err error) { data []byte ok bool ) + text = strings.ReplaceAll(text, " ", "") ttsURL, ok = lolimiMap[name] if !ok { ttsURL = fmt.Sprintf(genshinURL, text, name)