Skip to content

Commit

Permalink
beta324
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoshinonyaruko committed Feb 18, 2024
1 parent 7acd904 commit 256dd8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Processor/ProcessGroupMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ func (p *Processors) ProcessGroupMessage(data *dto.WSGroupATMessageData) error {
groupMsg.IsBindedGroupId = IsBindedGroupId
if IsBindedUserId {
groupMsg.Avatar, _ = GenerateAvatarURL(userid64)
} else {
groupMsg.Avatar, _ = GenerateAvatarURLV2(data.Author.ID)
}
}
//根据条件判断是否增加nick和card
Expand Down
8 changes: 8 additions & 0 deletions Processor/Processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,14 @@ func GenerateAvatarURL(userID int64) (string, error) {
return fmt.Sprintf("http://q%d.qlogo.cn/g?b=qq&nk=%d&s=640", qNumber, userID), nil
}

// GenerateAvatarURLV2 生成根据32位ID 和 Appid 组合的 新QQ 头像 URL
func GenerateAvatarURLV2(openid string) (string, error) {

appidstr := config.GetAppIDStr()
// 构建并返回 URL
return fmt.Sprintf("https://q.qlogo.cn/qqapp/%s/%s/640", appidstr, openid), nil
}

// 生成link卡片
func generateMdByConfig() (md *dto.Markdown, kb *keyboard.MessageKeyboard) {
//相关配置获取
Expand Down

0 comments on commit 256dd8d

Please sign in to comment.