Skip to content

Commit 02d26ce

Browse files
xbshengTakhoffman
andauthored
docs(feishu): Feishu docs – add verificationToken and align zh-CN with EN (openclaw#31555) thanks @xbsheng
Verified: - pnpm build - pnpm test:macmini - pnpm check (blocked locally by pre-existing mainline lint issue in src/scripts/ci-changed-scope.test.ts unrelated to this PR) Co-authored-by: xbsheng <56357338+xbsheng@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
1 parent 99a48aa commit 02d26ce

4 files changed

Lines changed: 106 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai
66

77
### Changes
88

9+
- Docs/Feishu webhook setup: clarify `verificationToken` configuration with Open Platform navigation steps, and align Feishu sender-allowlist guidance plus zh-CN channel documentation with current runtime behavior. (#31555)
910
- Secrets/SecretRef coverage: expand SecretRef support across the full supported user-supplied credential surface (64 targets total), including runtime collectors, `openclaw secrets` planning/apply/audit flows, onboarding SecretInput UX, and related docs; unresolved refs now fail fast on active surfaces while inactive surfaces report non-blocking diagnostics. (#29580) Thanks @joshavant.
1011
- Tools/PDF analysis: add a first-class `pdf` tool with native Anthropic and Google PDF provider support, extraction fallback for non-native models, configurable defaults (`agents.defaults.pdfModel`, `pdfMaxBytesMb`, `pdfMaxPages`), and docs/tests covering routing, validation, and registration. (#31319) Thanks @tyler6204.
1112
- Outbound adapters/plugins: add shared `sendPayload` support across direct-text-media, Discord, Slack, WhatsApp, Zalo, and Zalouser with multi-media iteration and chunk-aware text fallback. (#30144) Thanks @nohat.

docs/channels/feishu.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,17 @@ Edit `~/.openclaw/openclaw.json`:
197197

198198
If you use `connectionMode: "webhook"`, set `verificationToken`. The Feishu webhook server binds to `127.0.0.1` by default; set `webhookHost` only if you intentionally need a different bind address.
199199

200+
#### Verification Token (webhook mode)
201+
202+
When using webhook mode, set `channels.feishu.verificationToken` in your config. To get the value:
203+
204+
1. In Feishu Open Platform, open your app
205+
2. Go to **Development****Events & Callbacks** (开发配置 → 事件与回调)
206+
3. Open the **Encryption** tab (加密策略)
207+
4. Copy **Verification Token**
208+
209+
![Verification Token location](../images/feishu-verification-token.png)
210+
200211
### Configure via environment variables
201212

202213
```bash
@@ -359,9 +370,9 @@ After approval, you can chat normally.
359370
}
360371
```
361372

362-
### Allow specific users to run control commands in a group (e.g. /reset, /new)
373+
### Restrict which senders can message in a group (sender allowlist)
363374

364-
In addition to allowing the group itself, control commands are gated by the **sender** open_id.
375+
In addition to allowing the group itself, **all messages** in that group are gated by the sender open_id: only users listed in `groups.<chat_id>.allowFrom` have their messages processed; messages from other members are ignored (this is full sender-level gating, not only for control commands like /reset or /new).
365376

366377
```json5
367378
{
73.2 KB
Loading

docs/zh-CN/channels/feishu.md

Lines changed: 92 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,19 @@ openclaw channels add
201201
}
202202
```
203203

204+
若使用 `connectionMode: "webhook"`,需设置 `verificationToken`。飞书 Webhook 服务默认绑定 `127.0.0.1`;仅在需要不同监听地址时设置 `webhookHost`
205+
206+
#### 获取 Verification Token(仅 Webhook 模式)
207+
208+
使用 Webhook 模式时,需在配置中设置 `channels.feishu.verificationToken`。获取方式:
209+
210+
1. 在飞书开放平台打开您的应用
211+
2. 进入 **开发配置****事件与回调**
212+
3. 打开 **加密策略** 选项卡
213+
4. 复制 **Verification Token**(校验令牌)
214+
215+
![Verification Token 位置](/images/feishu-verification-token.png)
216+
204217
### 通过环境变量配置
205218

206219
```bash
@@ -228,6 +241,34 @@ export FEISHU_APP_SECRET="xxx"
228241
}
229242
```
230243

244+
### 配额优化
245+
246+
可通过以下可选配置减少飞书 API 调用:
247+
248+
- `typingIndicator`(默认 `true`):设为 `false` 时不发送“正在输入”状态。
249+
- `resolveSenderNames`(默认 `true`):设为 `false` 时不拉取发送者资料。
250+
251+
可在渠道级或账号级配置:
252+
253+
```json5
254+
{
255+
channels: {
256+
feishu: {
257+
typingIndicator: false,
258+
resolveSenderNames: false,
259+
accounts: {
260+
main: {
261+
appId: "cli_xxx",
262+
appSecret: "xxx",
263+
typingIndicator: true,
264+
resolveSenderNames: false,
265+
},
266+
},
267+
},
268+
},
269+
}
270+
```
271+
231272
---
232273

233274
## 第三步:启动并测试
@@ -280,7 +321,7 @@ openclaw pairing approve feishu <配对码>
280321
**1. 群组策略**`channels.feishu.groupPolicy`):
281322

282323
- `"open"` = 允许群组中所有人(默认)
283-
- `"allowlist"` = 仅允许 `groupAllowFrom` 中的用户
324+
- `"allowlist"` = 仅允许 `groupAllowFrom` 中的群组
284325
- `"disabled"` = 禁用群组消息
285326

286327
**2. @提及要求**`channels.feishu.groups.<chat_id>.requireMention`):
@@ -321,14 +362,36 @@ openclaw pairing approve feishu <配对码>
321362
}
322363
```
323364

324-
### 仅允许特定用户在群组中使用
365+
### 仅允许特定群组
366+
367+
```json5
368+
{
369+
channels: {
370+
feishu: {
371+
groupPolicy: "allowlist",
372+
// 群组 ID 格式为 oc_xxx
373+
groupAllowFrom: ["oc_xxx", "oc_yyy"],
374+
},
375+
},
376+
}
377+
```
378+
379+
### 仅允许特定成员在群组中发信(发送者白名单)
380+
381+
除群组白名单外,该群组内**所有消息**均按发送者 open_id 校验:仅 `groups.<chat_id>.allowFrom` 中列出的用户消息会被处理,其他成员的消息会被忽略(此为发送者级白名单,不仅针对 /reset、/new 等控制命令)。
325382

326383
```json5
327384
{
328385
channels: {
329386
feishu: {
330387
groupPolicy: "allowlist",
331-
groupAllowFrom: ["ou_xxx", "ou_yyy"],
388+
groupAllowFrom: ["oc_xxx"],
389+
groups: {
390+
oc_xxx: {
391+
// 用户 open_id 格式为 ou_xxx
392+
allowFrom: ["ou_user1", "ou_user2"],
393+
},
394+
},
332395
},
333396
},
334397
}
@@ -428,12 +491,13 @@ openclaw pairing list feishu
428491

429492
### 多账号配置
430493

431-
如果需要管理多个飞书机器人:
494+
如果需要管理多个飞书机器人,可配置 `defaultAccount` 指定出站未显式指定 `accountId` 时使用的账号
432495

433496
```json5
434497
{
435498
channels: {
436499
feishu: {
500+
defaultAccount: "main",
437501
accounts: {
438502
main: {
439503
appId: "cli_xxx",
@@ -578,23 +642,29 @@ openclaw pairing list feishu
578642

579643
主要选项:
580644

581-
| 配置项 | 说明 | 默认值 |
582-
| ------------------------------------------------- | ------------------------------ | --------- |
583-
| `channels.feishu.enabled` | 启用/禁用渠道 | `true` |
584-
| `channels.feishu.domain` | API 域名(`feishu``lark`| `feishu` |
585-
| `channels.feishu.accounts.<id>.appId` | 应用 App ID | - |
586-
| `channels.feishu.accounts.<id>.appSecret` | 应用 App Secret | - |
587-
| `channels.feishu.accounts.<id>.domain` | 单账号 API 域名覆盖 | `feishu` |
588-
| `channels.feishu.dmPolicy` | 私聊策略 | `pairing` |
589-
| `channels.feishu.allowFrom` | 私聊白名单(open_id 列表) | - |
590-
| `channels.feishu.groupPolicy` | 群组策略 | `open` |
591-
| `channels.feishu.groupAllowFrom` | 群组白名单 | - |
592-
| `channels.feishu.groups.<chat_id>.requireMention` | 是否需要 @提及 | `true` |
593-
| `channels.feishu.groups.<chat_id>.enabled` | 是否启用该群组 | `true` |
594-
| `channels.feishu.textChunkLimit` | 消息分块大小 | `2000` |
595-
| `channels.feishu.mediaMaxMb` | 媒体大小限制 | `30` |
596-
| `channels.feishu.streaming` | 启用流式卡片输出 | `true` |
597-
| `channels.feishu.blockStreaming` | 启用块级流式 | `true` |
645+
| 配置项 | 说明 | 默认值 |
646+
| ------------------------------------------------- | --------------------------------- | ---------------- |
647+
| `channels.feishu.enabled` | 启用/禁用渠道 | `true` |
648+
| `channels.feishu.domain` | API 域名(`feishu``lark`| `feishu` |
649+
| `channels.feishu.connectionMode` | 事件传输模式(websocket/webhook) | `websocket` |
650+
| `channels.feishu.defaultAccount` | 出站路由默认账号 ID | `default` |
651+
| `channels.feishu.verificationToken` | Webhook 模式必填 | - |
652+
| `channels.feishu.webhookPath` | Webhook 路由路径 | `/feishu/events` |
653+
| `channels.feishu.webhookHost` | Webhook 监听地址 | `127.0.0.1` |
654+
| `channels.feishu.webhookPort` | Webhook 监听端口 | `3000` |
655+
| `channels.feishu.accounts.<id>.appId` | 应用 App ID | - |
656+
| `channels.feishu.accounts.<id>.appSecret` | 应用 App Secret | - |
657+
| `channels.feishu.accounts.<id>.domain` | 单账号 API 域名覆盖 | `feishu` |
658+
| `channels.feishu.dmPolicy` | 私聊策略 | `pairing` |
659+
| `channels.feishu.allowFrom` | 私聊白名单(open_id 列表) | - |
660+
| `channels.feishu.groupPolicy` | 群组策略 | `open` |
661+
| `channels.feishu.groupAllowFrom` | 群组白名单 | - |
662+
| `channels.feishu.groups.<chat_id>.requireMention` | 是否需要 @提及 | `true` |
663+
| `channels.feishu.groups.<chat_id>.enabled` | 是否启用该群组 | `true` |
664+
| `channels.feishu.textChunkLimit` | 消息分块大小 | `2000` |
665+
| `channels.feishu.mediaMaxMb` | 媒体大小限制 | `30` |
666+
| `channels.feishu.streaming` | 启用流式卡片输出 | `true` |
667+
| `channels.feishu.blockStreaming` | 启用块级流式 | `true` |
598668

599669
---
600670

@@ -614,6 +684,7 @@ openclaw pairing list feishu
614684
### 接收
615685

616686
- ✅ 文本消息
687+
- ✅ 富文本(帖子)
617688
- ✅ 图片
618689
- ✅ 文件
619690
- ✅ 音频

0 commit comments

Comments
 (0)