From a72a688a62b6d14f1767c95f05b0af8827330748 Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Sat, 10 Oct 2020 17:07:56 +0800 Subject: [PATCH] fix vip song. --- coolq/bot.go | 6 +++++- coolq/cqcode.go | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/coolq/bot.go b/coolq/bot.go index b132998..cd4c84f 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -153,7 +153,11 @@ func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int return 0 } if i, ok := elem.(*QQMusicElement); ok { - ret, err := bot.Client.SendGroupRichMessage(groupId, 100497308, 1, 4, client.RichClientInfo{ + var msgStyle uint32 = 4 + if i.MusicUrl == "" { + msgStyle = 0 // fix vip song + } + ret, err := bot.Client.SendGroupRichMessage(groupId, 100497308, 1, msgStyle, client.RichClientInfo{ Platform: 1, SdkVersion: "0.0.0", PackageName: "com.tencent.qqmusic", diff --git a/coolq/cqcode.go b/coolq/cqcode.go index e04eff6..78eea64 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -449,9 +449,6 @@ func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (message. if d["content"] != "" { content = d["content"] } - if purl == "" { - purl = "https://www.baidu.com" // fix vip song - } return &QQMusicElement{MusicElement: MusicElement{ Title: name, Summary: content,