feat(platform): enrich group metadata across adapters - #9851
Open
Soulter wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Sorry @Soulter, your pull request is larger than the review limit of 150,000 diff characters
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.
Motivation
Group metadata support was inconsistent across platform adapters. Many incoming group messages only exposed an ID, while
AstrMessageEvent.get_group()either returned no data or platform-specific partial results. This prevented conversation aliases and plugins from reliably displaying human-readable group information.Modifications / 改动点
Add
Group.member_countand make the baseget_group()return inbound or ID-only metadata as a safe fallback.Attach available group names to incoming messages without adding network requests to the hot path.
Enrich group name, avatar, owner, administrators, member count, and members where supported by aiocqhttp, QQ Official, Lark, Discord, Telegram, Slack, Mattermost, KOOK, LINE, Misskey, and Satori.
Preserve basic metadata when optional platform APIs fail, and avoid exposing incomplete member lists as complete results.
Resolve Lark private-message sender names through Contact v3 with bounded positive and negative caches, a five-second lookup timeout, and documented Contact scopes.
Use
guild-channeldisplay names for Discord group sessions.Use
group-topicdisplay names for Telegram forum topics when the Bot API has exposed the topic name through creation, edit, or root service messages. Unknown topic names safely fall back to the parent group name because the Bot API has no topic-by-ID lookup.Add adapter and fallback regression coverage without introducing new dependencies.
This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
Verification commands:
Results:
Checklist / 检查清单