Skip to content

feat(qqofficial): add markdown reply rendering - #2459

Open
QuasarRyan wants to merge 1 commit into
langbot-app:masterfrom
QuasarRyan:feat/qqofficial-markdown-rendering
Open

feat(qqofficial): add markdown reply rendering#2459
QuasarRyan wants to merge 1 commit into
langbot-app:masterfrom
QuasarRyan:feat/qqofficial-markdown-rendering

Conversation

@QuasarRyan

Copy link
Copy Markdown

概述 / Overview

请在此部分填写你实现/解决/优化的内容:
Summary of what you implemented/solved/optimized:

实现了 #2456 中提的需求:

  • 为 QQ Official Bot 增加“启用 Markdown 渲染”配置开关,位于机器人创建/编辑页面的适配器配置表单中,默认关闭以保持原有兼
    容性。
  • 开启后,非流式 C2C 私聊和 QQ 群聊的文本回复将以 QQ Markdown 消息格式发送(msg_type: 2)。
  • 关闭或未配置该开关时,继续使用原有纯文本消息格式(msg_type: 0)。
  • 频道群聊和频道私信不受该开关影响,继续以纯文本发送;相关限制已在 WebUI 配置说明中标明。
  • 未修改 C2C 流式回复及富媒体消息逻辑。
  • 补充单元测试,覆盖 Markdown 请求体、开关的 C2C/群聊分流、默认纯文本兼容行为,以及频道消息不受开关影响的行为。

更改前后对比截图 / Screenshots

请在此部分粘贴更改前后对比截图(可以是界面截图、控制台输出、对话截图等):
Please paste the screenshots of changes before and after here (can be interface screenshots, console output, conversation screenshots, etc.):

修改前 / Before:

image image

修改后 / After:
src/langbot/pkg/platform/sources/qqofficial.yaml新增字段:

    - name: enable-markdown-rendering
      label:
        en_US: Enable Markdown Rendering
        zh_Hans: 启用 Markdown 渲染
        zh_Hant: 啟用 Markdown 渲染
      description:
        en_US: Render non-stream C2C and QQ group text replies as Markdown. Channel messages always use plain text and are not affected by this setting.
        zh_Hans: 将非流式 C2C 私聊和 QQ 群聊文本回复渲染为 Markdown。频道消息始终以纯文本发送,不受此设置影响。
        zh_Hant: 將非串流 C2C 私聊與 QQ 群聊文字回覆渲染為 Markdown。頻道訊息一律以純文字傳送,不受此設定影響。
      type: boolean
      required: true
      default: false

图例为简体中文,提交中也包含英文和繁体中文

image image

检查清单 / Checklist

PR 作者完成 / For PR author

请在方括号间写x以打勾 / Please tick the box with x

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 我已签署或将在机器人提示后签署 CLA。 / I have signed, or will sign when prompted by the bot, the CLA.
  • 与项目所有者沟通过了吗? / Have you communicated with the project maintainer?
  • 我确定已自行测试所作的更改,确保功能符合预期。 / I have tested the changes and ensured they work as expected.

项目维护者完成 / For project maintainer

  • 相关 issues 链接了吗? / Have you linked the related issues?
  • 配置项写好了吗?迁移写好了吗?生效了吗? / Have you written the configuration items? Have you written the migration? Has it taken effect?
  • 依赖加到 pyproject.toml 和 core/bootutils/deps.py 了吗 / Have you added the dependencies to pyproject.toml and core/bootutils/deps.py?
  • 文档编写了吗? / Have you written the documentation?

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. eh: Feature enhance: 新功能添加 / add new features IM: qqofficial QQ 官方 API Webhook 适配器相关 / QQ API (Webhook) adapter related m: Platform 机器人管理相关 / Bots management labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eh: Feature enhance: 新功能添加 / add new features IM: qqofficial QQ 官方 API Webhook 适配器相关 / QQ API (Webhook) adapter related m: Platform 机器人管理相关 / Bots management size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant