Repository navigation
feat(qq-official): 成员头像按机器人 AppID + openid 显示 - #1232
Merged
Merged
Conversation
QQ 官方机器人只给 openid,之前头像只按数字 QQ 号拼 qlogo 地址,官方机器人的成员 在事件页等处一律退回首字母占位。qlogo 提供 qqapp/<AppID>/<openid> 地址,按这台 机器人的 AppID 拼出来即可取到真头像;Agent 看被 @ 成员和取头像时同样补上。
SuInk
force-pushed
the
claude/qq-official-member-avatars
branch
from
October 27, 2026 16:20
075b18a to
e82938b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QQ 官方机器人的成员现在能显示头像了:控制台事件页等用成员头像的地方,按「这台机器人的 AppID + openid」从 qlogo 取真头像,不再一律显示首字母占位;Agent 查看被 @ 成员和取成员头像时也能拿到同一个地址。
Why
QQ 官方机器人收到的发送者只有 openid,没有 QQ 号。原来的头像地址只按数字 QQ 号拼
q1.qlogo.cn/g?nk=<QQ号>,官方机器人的 openid 拼不出来,remoteAvatarURL和MemberAvatarURL对非 OneBot 平台直接返回空,界面只能退回首字母占位。改了什么
assistant.QQOfficialMemberAvatarURL(appID, openID):拼https://q.qlogo.cn/qqapp/<AppID>/<openid>/640,AppID 必须是数字、openid 必须是 32 位十六进制,否则返回空。remoteAvatarURL:成员头像先看是不是 QQ 官方机器人,是就用它的QQAppID拼地址,走现有的头像缓存和条件请求。单机器人部署的事件里profile_id为空时,只有一台官方机器人才算它的;数字 QQ 号拼不出地址时照旧走 OneBot。avatarSourceURL和「被@成员」那一行:官方机器人按事件所属机器人的 AppID 给地址。用户或开发者影响
验证
TestQQOfficialMemberAvatarURL(地址形状与非法输入)和TestRemoteAvatarURLForQQOfficialMembers(指定机器人、空 profile 兜底、数字 QQ 号仍走 OneBot、群头像不给地址),测试用合成号码。scripts/test-serial.sh ./webui ./model/assistant:-race和TZ=UTC均通过;gofmt、git diff --check、公开仓库审计通过。