🎨 优化 ERROR 格式

This commit is contained in:
fumiama
2022-08-16 15:15:29 +08:00
parent b4d6e1ef04
commit 70713c0719
58 changed files with 284 additions and 284 deletions

View File

@@ -141,7 +141,7 @@ func cloud163(keyword string) (msg message.MessageSegment) {
requestURL := "https://music.cyrilstudio.top/search?keywords=" + url.QueryEscape(keyword)
data, err := web.GetData(requestURL)
if err != nil {
msg = message.Text("ERROR:", err)
msg = message.Text("ERROR: ", err)
return
}
msg = message.Music("163", gjson.ParseBytes(data).Get("result.songs.0.id").Int())
@@ -153,7 +153,7 @@ func qqmusic(keyword string) (msg message.MessageSegment) {
requestURL := "https://c.y.qq.com/soso/fcgi-bin/client_search_cp?w=" + url.QueryEscape(keyword)
data, err := web.RequestDataWith(web.NewDefaultClient(), requestURL, "GET", "", web.RandUA())
if err != nil {
msg = message.Text("ERROR:", err)
msg = message.Text("ERROR: ", err)
return
}
info := gjson.ParseBytes(data[9 : len(data)-1]).Get("data.song.list.0")