mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
优化输出
This commit is contained in:
parent
3351450d88
commit
ca7ac08808
@ -38,17 +38,17 @@ func init() {
|
|||||||
s := ahsaitts.NewSpeaker()
|
s := ahsaitts.NewSpeaker()
|
||||||
err := s.SetName(ctx.State["ahsainame"].(string))
|
err := s.SetName(ctx.State["ahsainame"].(string))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
u, err := s.Speak(ctx.State["ahsaitext"].(string))
|
u, err := s.Speak(ctx.State["ahsaitext"].(string))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = ahsaitts.SaveOggToFile(u, ahsaiFile)
|
err = ahsaitts.SaveOggToFile(u, ahsaiFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.SendChain(message.Record("file:///" + file.BOTPATH + "/" + ahsaiFile))
|
ctx.SendChain(message.Record("file:///" + file.BOTPATH + "/" + ahsaiFile))
|
||||||
|
|||||||
@ -289,12 +289,12 @@ func init() {
|
|||||||
client := &http.Client{Transport: tr}
|
client := &http.Client{Transport: tr}
|
||||||
data, err := web.RequestDataWith(client, fmt.Sprintf(danmakuAPI, id, pagenum), "GET", "", web.RandUA())
|
data, err := web.RequestDataWith(client, fmt.Sprintf(danmakuAPI, id, pagenum), "GET", "", web.RandUA())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = json.Unmarshal(data, &danmaku)
|
err = json.Unmarshal(data, &danmaku)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", err))
|
ctx.SendChain(message.Text("ERROR: ", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
today := time.Now().Format("20060102150415")
|
today := time.Now().Format("20060102150415")
|
||||||
|
|||||||
@ -20,7 +20,7 @@ func init() {
|
|||||||
msg := []string{ctx.State["regex_matched"].([]string)[2]}
|
msg := []string{ctx.State["regex_matched"].([]string)[2]}
|
||||||
data, err := tl.Translate(msg[0])
|
data, err := tl.Translate(msg[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("Error:", data))
|
ctx.SendChain(message.Text("ERROR: ", data))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.SendChain(message.Text(data))
|
ctx.SendChain(message.Text(data))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user