Skip to content
Back to search

feishu-bot-chat-plugin

OpenClaw plugin for bot-to-bot @ communication in Feishu group chats

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/leochens--feishu-bot-chat-plugin/badge.svg)](/listings/leochens--feishu-bot-chat-plugin)

HTML

<a href="/listings/leochens--feishu-bot-chat-plugin"><img src="/api/listings/leochens--feishu-bot-chat-plugin/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# 从 ClawHub 安装
openclaw plugins install feishu-bot-chat

# 或从本地安装
openclaw plugins install .

# 启用插件
openclaw plugins enable feishu-bot-chat

重启 gateway:`openclaw gateway --force`

插件会自动发现所有绑定了飞书 account 的 agent,无需额外配置。

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 147 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Feishu Bot Chat Plugin
  2. OpenClaw 插件,实现飞书群聊中多个 Bot 之间的 @ 互相通信。
  3. ## 为什么需要这个插件
  4. 飞书支持 Bot 之间通过 @ 直接通信(需开通权限),但 Bot 需要知道群里有哪些其他 Bot、如何正确使用 `<at>` 标签、以及何时该 @ 何时不该 @。
  5. 这个插件解决的问题:
  6. 1. **自动发现** — 自动识别群内所有 Bot 及其 open_id,无需手动配置
  7. 2. **协作规则注入** — 向每个 Bot 的 system prompt 注入可用 Bot 列表和协作规则
  8. 3. **格式转换** — 将 `@botName` 文本自动转为飞书 `<at>` 标签
  9. 4. **消息过滤** — 过滤非 @ 的 Bot 消息,避免无关触发
  10. ## 前置条件
  11. 每个参与协作的 Bot 应用需要在飞书开发者后台开通:
  12. **`im:message.group_at_msg.include_bot:readonly`**(接收群聊中机器人 @机器人的消息)
  13. 路径:开发者后台 → 应用 → 权限管理 → 搜索上述权限 → 开通
  14. 开通后,Bot A 在群里 @ Bot B 时,Bot B 的 webhook 会原生收到这条消息。
  15. ## 工作原理
  16. ```
  17. 用户 @ Bot A → Bot A 回复并在消息中使用 <at> 标签 @ Bot B
  18. ↓
  19. 飞书原生投递:Bot B 的 webhook 收到消息
  20. ↓
  21. Bot B 处理任务,回复时 @ 回 Bot A
  22. ↓
  23. 飞书原生投递:Bot A 收到结果,汇总回复用户
  24. ```
  25. ### 三个 Hook
  26. | Hook | 作用 |
  27. |------|------|
  28. | `before_prompt_build` | 注入群内可用 Bot 列表和协作规则到 system prompt |
  29. | `message_sending` | 将 `@botName` 文本替换为飞书 `<at user_id="...">` 标签 |
  30. | `inbound_claim` | 过滤非 @ 的 Bot 消息;检测原生投递状态;注入发送者信息 |
  31. ### 自动发现
  32. 插件启动时自动从 OpenClaw 配置中发现所有飞书 Bot:
  33. 1. 读取 `bindings` — 找到所有 `channel=feishu` 且有 `accountId` 的 agent
  34. 2. 读取 `channels.feishu.accounts` — 获取每个 account 的 `appId`、`appSecret`
  35. 3. 调用飞书 `bot/v3/info` API — 获取每个 Bot 的 `open_id` 和真实名称
  36. 4. 缓存到 `~/.openclaw/fbc-registry/registry.json`(24 小时有效)
  37. ### 群成员过滤
  38. `before_prompt_build` 时会调用飞书群成员 API,只向 Bot 展示当前群内实际存在的其他 Bot,避免 @ 不在群里的 Bot。
  39. ## 安装
  40. ```bash
  41. # 从 ClawHub 安装
  42. openclaw plugins install feishu-bot-chat
  43. # 或从本地安装
  44. openclaw plugins install .
  45. # 启用插件
  46. openclaw plugins enable feishu-bot-chat
  47. ```
  48. 重启 gateway:`openclaw gateway --force`
  49. 插件会自动发现所有绑定了飞书 account 的 agent,无需额外配置。
  50. ## 配置(可选)
  51. 默认零配置即可工作。如需手动指定 Bot 列表(覆盖自动发现),可在 `openclaw.json` 中配置:
  52. ```json
  53. {
  54. "plugins": {
  55. "entries": {
  56. "feishu-bot-chat": {
  57. "enabled": true,
  58. "config": {
  59. "botRegistry": {
  60. "agent-id-1": {
  61. "accountId": "feishu-account-id",
  62. "botOpenId": "ou_xxxxxxxxxxxxxxxx",
  63. "botName": "显示名称"
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. }
  71. ```
  72. ## 自动发现缓存
  73. 发现结果缓存在 `~/.openclaw/fbc-registry/registry.json`,24 小时有效。
  74. - gateway 重启时如果缓存有效,不重复调 API
  75. - 删除该文件可强制重新发现
  76. - 新增 agent 绑定后,缓存会自动检测到不完整并重新发现
  77. ## 调试
  78. 插件将详细日志写入 `logs/a2a-debug-YYYY-MM-DD.log`(按天轮转):
  79. ```bash
  80. tail -f logs/a2a-debug-$(date +%Y-%m-%d).log
  81. ```
  82. ## 构建
  83. 打包为 zip 用于上传 ClawHub:
  84. ```bash
  85. npm run build
  86. # 输出: dist/feishu-bot-chat-{version}.zip
  87. ```
  88. ## 限制
  89. - 仅支持飞书群聊场景(`channelId === 'feishu'`)
  90. - 需要每个 Bot 应用开通 `im:message.group_at_msg.include_bot:readonly` 权限
  91. - 飞书卡片中的 `<at>` 标签不会触发 webhook 投递,Bot 需使用纯文本消息 @
  92. - 自动发现需要 agent 在 bindings 中有 `accountId` 匹配
  93. ## 内置 Skills
  94. 插件提供 6 个 A2A 协作 Skill,群聊中自动生效:
  95. | Skill | 说明 |
  96. |-------|------|
  97. | `a2a-collaboration-guide` | 协作规则速查手册(始终激活) |
  98. | `a2a-task-decompose` | 任务分解与分配指南 |
  99. | `a2a-result-merge` | 多 bot 结果汇总 |
  100. | `a2a-interrupt` | 协作中断与取消处理 |
  101. | `a2a-status-check` | 协作状态查询与进度汇报 |
  102. | `a2a-mode-switch` | 协作模式切换(独立/指定/全力) |
  103. ## License
  104. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.