优化输出

This commit is contained in:
源文雨
2022-09-10 13:24:15 +08:00
parent 3351450d88
commit ca7ac08808
3 changed files with 16 additions and 16 deletions

View File

@@ -38,17 +38,17 @@ func init() {
s := ahsaitts.NewSpeaker()
err := s.SetName(ctx.State["ahsainame"].(string))
if err != nil {
ctx.SendChain(message.Text("Error:", err))
ctx.SendChain(message.Text("ERROR: ", err))
return
}
u, err := s.Speak(ctx.State["ahsaitext"].(string))
if err != nil {
ctx.SendChain(message.Text("Error:", err))
ctx.SendChain(message.Text("ERROR: ", err))
return
}
err = ahsaitts.SaveOggToFile(u, ahsaiFile)
if err != nil {
ctx.SendChain(message.Text("Error:", err))
ctx.SendChain(message.Text("ERROR: ", err))
return
}
ctx.SendChain(message.Record("file:///" + file.BOTPATH + "/" + ahsaiFile))