feat: add avatar field to GroupInfo interface#535
Merged
Conversation
Co-authored-by: sj817 <[email protected]>
Copilot
AI
changed the title
[WIP] Feat: 将群头像放到群信息接口里面
feat: add avatar field to GroupInfo interface
Oct 2, 2025
sj817
marked this pull request as ready for review
October 2, 2025 00:15
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an optional avatar field to the GroupInfo interface to include group avatar URLs when retrieving group information, eliminating the need for separate API calls.
- Added optional
avatar?: stringfield toGroupInfointerface - Modified
getGroupInfoandgetGroupListmethods to automatically fetch and include avatar URLs - Converted
getGroupListto usePromise.allto handle async avatar fetching
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/core/src/types/adapter/apiResponse.ts |
Added optional avatar field to GroupInfo interface |
packages/core/src/adapter/onebot/core/core.ts |
Updated both getGroupInfo and getGroupList methods to fetch and include avatar URLs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
|
你可以通过以下命令安装该版本: |
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.
Problem
Previously, developers needed to make two separate API calls to get both group information and the group avatar URL:
This resulted in unnecessary code duplication and extra async operations.
Solution
Added an optional
avatarfield to theGroupInfointerface that automatically includes the group avatar URL when retrieving group information:Changes
1. Updated
GroupInfoInterfaceAdded optional
avatar?: stringfield topackages/core/src/types/adapter/apiResponse.ts:2. Updated
getGroupInfoMethodModified
packages/core/src/adapter/onebot/core/core.tsto automatically fetch and include the avatar URL:3. Updated
getGroupListMethodAlso updated
getGroupListto include avatar URLs for consistency across the API.Benefits
getGroupInfoandgetGroupListnow include avatar informationCloses #[issue_number]
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.comnode /home/REDACTED/.npm/_npx/4876f32048baf8ac/node_modules/.bin/prebuild-install -r napi --pkg_version=5.1.7 --pkg_name=sqlite3(dns block)node /home/REDACTED/.npm/_npx/c65dbefa27d408e0/node_modules/.bin/prebuild-install -r node --pkg_version=0.12.0 --pkg_name=node-pty-prebuilt-multiarch(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.