Skip to content

chore: update version to 7.12.6#746

Merged
idranme merged 3 commits into
mainfrom
dev
Apr 28, 2026
Merged

chore: update version to 7.12.6#746
idranme merged 3 commits into
mainfrom
dev

Conversation

@idranme
Copy link
Copy Markdown
Collaborator

@idranme idranme commented Apr 28, 2026

Summary by Sourcery

更新群公告处理逻辑并提升项目版本。

New Features:

  • 在群公告响应中暴露公告置顶状态。
  • 返回群公告时,同时包含普通群公告和即时群公告。

Enhancements:

  • 通过引入可复用的 GroupBulletinFeed 接口重构群公告类型。
  • 当存在即时公告时,按发布时间对群公告进行排序。
  • 将导出的应用版本提升至 7.12.6
Original summary in English

Summary by Sourcery

Update group bulletin handling and bump the project version.

New Features:

  • Expose bulletin pin status in group notice responses.
  • Include both regular and instant group bulletins when returning group notices.

Enhancements:

  • Refactor group bulletin types by introducing a reusable GroupBulletinFeed interface.
  • Sort group notices by publish time when instant bulletins are present.
  • Bump the exported application version to 7.12.6.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 28, 2026

Reviewer's Guide

将群公告类型重构为复用共享接口,更新群公告获取逻辑以包含带置顶信息和条件排序的 inst 公告,并将包版本升级到 7.12.6。

更新后 GetGroupNotice 处理流程的时序图

sequenceDiagram
  actor Client
  participant GetGroupNotice
  participant Ctx
  participant NtGroupApi

  Client->>GetGroupNotice: invoke _handle(payload)
  GetGroupNotice->>Ctx: access ntGroupApi
  Ctx-->>GetGroupNotice: ntGroupApi
  GetGroupNotice->>NtGroupApi: getGroupBulletinList(group_id)
  NtGroupApi-->>GetGroupNotice: GroupBulletinListResult data

  GetGroupNotice->>GetGroupNotice: merge [...data.feeds, ...data.inst]
  loop for each feed
    GetGroupNotice->>GetGroupNotice: map feed to Notice
      GetGroupNotice->>GetGroupNotice: settings.is_show_edit_card = !!isShowEditCard
      GetGroupNotice->>GetGroupNotice: settings.tip_window = !tipWindowType
      GetGroupNotice->>GetGroupNotice: settings.confirm_required = !!confirmRequired
      GetGroupNotice->>GetGroupNotice: settings.pinned = !!pinned
  end

  alt data.inst.length > 0
    GetGroupNotice->>GetGroupNotice: sort result by publish_time desc
  end

  GetGroupNotice-->>Client: Notice[] result
Loading

更新后的群公告类型与 GetGroupNotice 的类图

classDiagram
  class GroupBulletinFeed {
    string uin
    string feedId
    string publishTime
    number type
    number fn
    number cn
    number vn
    number pinned
    number readNum
    number is_read
    number is_all_confirm
  }

  class GroupBulletinFeedMsg {
    string text
    string textFace
    GroupBulletinFeedPic[] pics
    string title
  }

  class GroupBulletinFeedPic {
    string id
    number width
    number height
  }

  class GroupBulletinFeedSettings {
    number isShowEditCard
    number remindTs
    number tipWindowType
    number confirmRequired
  }

  class GroupBulletinListResult {
    string groupCode
    number srvCode
    number readOnly
    number role
    GroupBulletinFeed[] inst
    GroupBulletinFeed[] feeds
  }

  class Notice {
    string notice_id
    number sender_id
    number publish_time
    string message
    string image
    boolean is_pinned
    NoticeSettings settings
  }

  class NoticeSettings {
    boolean is_show_edit_card
    boolean tip_window
    boolean confirm_required
    boolean pinned
  }

  class BaseAction {
    <<abstract>>
  }

  class GetGroupNotice {
    +_handle(payload)
  }

  class Ctx {
    NtGroupApi ntGroupApi
  }

  class NtGroupApi {
    +getGroupBulletinList(groupId) GroupBulletinListResult
  }

  GroupBulletinFeed o-- GroupBulletinFeedMsg : msg
  GroupBulletinFeedMsg o-- GroupBulletinFeedPic : pics
  GroupBulletinFeed o-- GroupBulletinFeedSettings : settings

  GroupBulletinListResult o-- GroupBulletinFeed : inst
  GroupBulletinListResult o-- GroupBulletinFeed : feeds

  Notice o-- NoticeSettings : settings

  GetGroupNotice ..|> BaseAction
  GetGroupNotice --> Ctx : uses
  Ctx o-- NtGroupApi : has
  GetGroupNotice --> NtGroupApi : calls
  GetGroupNotice --> Notice : returns
Loading

文件级变更

Change Details Files
为群公告 feed 引入可复用类型,并将其应用到群公告列表结果中。
  • 定义 GroupBulletinFeed 接口,抽象公告 feed 结构,包括消息、设置和状态字段。
  • 将 GroupBulletinListResult 中内联的公告 feed 数组类型替换为 GroupBulletinFeed[],用于 feeds 和 inst 属性。
src/ntqqapi/types/group.ts
增强 GetGroupNotice 以合并即时和普通公告、暴露置顶状态,并在存在即时公告时进行排序。
  • 扩展 Notice.settings 类型,新增 pinned 布尔标记。
  • 遍历 getGroupBulletinList 返回的合并列表(feeds 和 inst),而不再仅处理 feeds。
  • 将底层 feed 中新的 pinned 属性映射到 Notice.settings.pinned 字段。
  • 当存在任意 inst 公告时,返回的公告按 publish_time 降序排序。
src/onebot11/action/go-cqhttp/GetGroupNotice.ts
为新版本更新项目元数据。
  • 将导出的版本常量从 7.12.5 提升到 7.12.6。
  • 根据新版本调整打包分发的元数据和相关文档路径。
src/version.ts
a/doc/微信相关.txt
b/doc/微信相关.txt
package-dist.json

Tips and commands

Interacting with Sourcery

  • 触发新的代码审查: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 在某条审查评论下回复,要求 Sourcery 从该评论创建 issue。你也可以直接回复 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题任意位置写上 @sourcery-ai,即可随时生成标题。也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 正文任意位置写上 @sourcery-ai summary,即可在对应位置生成 PR 摘要。也可以在 Pull Request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 中评论 @sourcery-ai guide,可随时(重新)生成审阅者指南。
  • 批量解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。如果你已经处理了所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审查: 在 Pull Request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。特别适用于你想从一次全新的审查开始——别忘了再评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

打开你的 dashboard 来:

  • 启用或禁用审查功能,例如 Sourcery 自动生成的 Pull Request 摘要、审阅者指南等。
  • 修改审查语言。
  • 添加、移除或编辑自定义审查指令。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

Refactors the group bulletin types to reuse a shared interface, updates the group notice retrieval to include inst bulletins with pin information and conditional sorting, and bumps the package version to 7.12.6.

Sequence diagram for updated GetGroupNotice processing

sequenceDiagram
  actor Client
  participant GetGroupNotice
  participant Ctx
  participant NtGroupApi

  Client->>GetGroupNotice: invoke _handle(payload)
  GetGroupNotice->>Ctx: access ntGroupApi
  Ctx-->>GetGroupNotice: ntGroupApi
  GetGroupNotice->>NtGroupApi: getGroupBulletinList(group_id)
  NtGroupApi-->>GetGroupNotice: GroupBulletinListResult data

  GetGroupNotice->>GetGroupNotice: merge [...data.feeds, ...data.inst]
  loop for each feed
    GetGroupNotice->>GetGroupNotice: map feed to Notice
      GetGroupNotice->>GetGroupNotice: settings.is_show_edit_card = !!isShowEditCard
      GetGroupNotice->>GetGroupNotice: settings.tip_window = !tipWindowType
      GetGroupNotice->>GetGroupNotice: settings.confirm_required = !!confirmRequired
      GetGroupNotice->>GetGroupNotice: settings.pinned = !!pinned
  end

  alt data.inst.length > 0
    GetGroupNotice->>GetGroupNotice: sort result by publish_time desc
  end

  GetGroupNotice-->>Client: Notice[] result
Loading

Class diagram for updated group bulletin types and GetGroupNotice

classDiagram
  class GroupBulletinFeed {
    string uin
    string feedId
    string publishTime
    number type
    number fn
    number cn
    number vn
    number pinned
    number readNum
    number is_read
    number is_all_confirm
  }

  class GroupBulletinFeedMsg {
    string text
    string textFace
    GroupBulletinFeedPic[] pics
    string title
  }

  class GroupBulletinFeedPic {
    string id
    number width
    number height
  }

  class GroupBulletinFeedSettings {
    number isShowEditCard
    number remindTs
    number tipWindowType
    number confirmRequired
  }

  class GroupBulletinListResult {
    string groupCode
    number srvCode
    number readOnly
    number role
    GroupBulletinFeed[] inst
    GroupBulletinFeed[] feeds
  }

  class Notice {
    string notice_id
    number sender_id
    number publish_time
    string message
    string image
    boolean is_pinned
    NoticeSettings settings
  }

  class NoticeSettings {
    boolean is_show_edit_card
    boolean tip_window
    boolean confirm_required
    boolean pinned
  }

  class BaseAction {
    <<abstract>>
  }

  class GetGroupNotice {
    +_handle(payload)
  }

  class Ctx {
    NtGroupApi ntGroupApi
  }

  class NtGroupApi {
    +getGroupBulletinList(groupId) GroupBulletinListResult
  }

  GroupBulletinFeed o-- GroupBulletinFeedMsg : msg
  GroupBulletinFeedMsg o-- GroupBulletinFeedPic : pics
  GroupBulletinFeed o-- GroupBulletinFeedSettings : settings

  GroupBulletinListResult o-- GroupBulletinFeed : inst
  GroupBulletinListResult o-- GroupBulletinFeed : feeds

  Notice o-- NoticeSettings : settings

  GetGroupNotice ..|> BaseAction
  GetGroupNotice --> Ctx : uses
  Ctx o-- NtGroupApi : has
  GetGroupNotice --> NtGroupApi : calls
  GetGroupNotice --> Notice : returns
Loading

File-Level Changes

Change Details Files
Introduce a reusable type for group bulletin feeds and apply it to the group bulletin list result.
  • Define a GroupBulletinFeed interface capturing bulletin feed structure including message, settings, and status fields.
  • Replace inline bulletin feed array types in GroupBulletinListResult with GroupBulletinFeed[] for both feeds and inst properties.
src/ntqqapi/types/group.ts
Enhance GetGroupNotice to merge instant and regular bulletins, expose pinned status, and sort when instant bulletins are present.
  • Extend the Notice.settings type to include a pinned boolean flag.
  • Iterate over a merged list of feeds and inst bulletins returned from getGroupBulletinList instead of only feeds.
  • Map the new pinned property from the underlying feed to the Notice.settings.pinned field.
  • When any inst bulletins exist, return the notices sorted by publish_time in descending order.
src/onebot11/action/go-cqhttp/GetGroupNotice.ts
Update project metadata for the new release.
  • Bump exported version constant from 7.12.5 to 7.12.6.
  • Adjust packaged distribution metadata and associated documentation paths for the new version.
src/version.ts
a/doc/微信相关.txt
b/doc/微信相关.txt
package-dist.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • GroupBulletinFeed 同时复用于 feedsinst,假设它们始终具有完全相同的结构(包括 settingspinned);如果 inst 的结构可能不同或只被部分填充,建议将部分字段改为可选,或者为其定义一个更具体的类型,以避免在类型定义中固化运行时才成立的假设。
  • 目前按 publish_time 排序只会在 data.inst.length > 0 时执行;如果希望无论通知来源如何都保持一致的排序行为,那么始终对合并后的数组做排序可能会更清晰,也更不容易让人产生误解。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Reusing `GroupBulletinFeed` for both `feeds` and `inst` assumes they always share the exact same shape (including `settings` and `pinned`); if `inst` can differ or be partially populated, consider making some fields optional or defining a more specific type to avoid runtime assumptions being baked into the typings.
- The sorting by `publish_time` only runs when `data.inst.length > 0`; if consistent ordering is desired regardless of where the notices come from, it may be clearer and less surprising to always sort the combined array.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进未来的评审。
Original comment in English

Hey - I've left some high level feedback:

  • Reusing GroupBulletinFeed for both feeds and inst assumes they always share the exact same shape (including settings and pinned); if inst can differ or be partially populated, consider making some fields optional or defining a more specific type to avoid runtime assumptions being baked into the typings.
  • The sorting by publish_time only runs when data.inst.length > 0; if consistent ordering is desired regardless of where the notices come from, it may be clearer and less surprising to always sort the combined array.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Reusing `GroupBulletinFeed` for both `feeds` and `inst` assumes they always share the exact same shape (including `settings` and `pinned`); if `inst` can differ or be partially populated, consider making some fields optional or defining a more specific type to avoid runtime assumptions being baked into the typings.
- The sorting by `publish_time` only runs when `data.inst.length > 0`; if consistent ordering is desired regardless of where the notices come from, it may be clearer and less surprising to always sort the combined array.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link
Copy Markdown

Test Report

Job Status
unit-test ✅ success
e2e-test ✅ success

✅ All tests passed

@idranme idranme merged commit 82b9185 into main Apr 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant