Skip to content

Commit 8bfee1a

Browse files
committed
✨ 添加语音
1 parent ac2d533 commit 8bfee1a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugin/crypter/handlers.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
package crypter
33

44
import (
5+
"github.com/FloatTech/AnimeAPI/airecord"
6+
"github.com/sirupsen/logrus"
57
zero "github.com/wdvxdr1123/ZeroBot"
68
"github.com/wdvxdr1123/ZeroBot/message"
79
)
@@ -10,7 +12,14 @@ import (
1012
func houEncryptHandler(ctx *zero.Ctx) {
1113
text := ctx.State["regex_matched"].([]string)[1]
1214
result := encodeHou(text)
13-
ctx.SendChain(message.Text(result))
15+
logrus.Infoln("[crypter] 回复内容:", result)
16+
recCfg := airecord.GetConfig()
17+
record := ctx.GetAIRecord(recCfg.ModelID, recCfg.Customgid, result)
18+
if record != "" {
19+
ctx.SendChain(message.Record(record))
20+
} else {
21+
ctx.SendChain(message.Text(result))
22+
}
1423
}
1524

1625
func houDecryptHandler(ctx *zero.Ctx) {

0 commit comments

Comments
 (0)