Skip to content

Commit dd9bd13

Browse files
committed
🐛 一定能点出歌
1 parent ca596c1 commit dd9bd13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugin/music/selecter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ func longzhu(keyword string) message.Segment {
6161
// 假设 data 是包含整个 JSON 数组的字节切片
6262
results := gjson.ParseBytes(data).Array()
6363
for _, result := range results {
64+
fmt.Print(result)
6465
if strings.Contains(strings.ToLower(result.Get("title").String()), strings.ToLower(keyword)) {
6566
if musicURL := result.Get("full_track").String(); musicURL != "" {
6667
return message.Record(musicURL)
6768
}
6869
}
6970
}
7071

72+
results = gjson.GetBytes(data, "#.full_track").Array()
7173
if len(results) > 0 {
72-
if musicURL := results[0].Get("full_track").String(); musicURL != "" {
74+
if musicURL := results[0].String(); musicURL != "" {
7375
return message.Record(musicURL)
7476
}
7577
}

0 commit comments

Comments
 (0)