diff --git a/coolq/cqcode.go b/coolq/cqcode.go
index 0b86843..d6e04a6 100644
--- a/coolq/cqcode.go
+++ b/coolq/cqcode.go
@@ -493,17 +493,15 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message.
return nil, errors.New("song not found")
}
name := info.Get("name").Str
+ jumpUrl := "https://y.music.163.com/m/song/" + d["id"]
+ musicUrl := "http://music.163.com/song/media/outer/url?id=" + d["id"]
+ picUrl := info.Get("album.picUrl").Str
artistName := ""
if info.Get("artists.0").Exists() {
artistName = info.Get("artists.0.name").Str
}
- xml := fmt.Sprintf(`- %s%s
`,
- name, d["id"], info.Get("album.picUrl").Str, d["id"], name, artistName)
- return &message.ServiceElement{
- Id: 60,
- Content: xml,
- SubType: "music",
- }, nil
+ json := fmt.Sprintf("{\"app\": \"com.tencent.structmsg\",\"desc\":\"音乐\",\"view\":\"music\",\"prompt\":\"[分享]%s\",\"ver\":\"0.0.0.1\",\"meta\":{ \"music\": { \"desc\": \"%s\", \"jumpUrl\": \"%s\", \"musicUrl\": \"%s\", \"preview\": \"%s\", \"tag\": \"网易云音乐\", \"title\":\"%s\"}}}", name,artistName, jumpUrl, musicUrl, picUrl, name)
+ return message.NewLightApp(json), nil
}
if d["type"] == "custom" {
xml := fmt.Sprintf(`- %s%s
`,