Skip to content

Commit 45eec81

Browse files
committed
refactor(issue-832): [bug]-飞书根本没法配置成功
1 parent e8c7ab0 commit 45eec81

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

docs/full-guide.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,15 @@ FEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your_hook_token
571571

572572
**完整步骤:**
573573

574-
1. 在飞书群聊中添加"自定义机器人",复制 Webhook URL。
575-
2. 设置 `FEISHU_WEBHOOK_URL`,格式通常为 `https://open.feishu.cn/open-apis/bot/v2/hook/...`。
576-
3. 回到飞书机器人「安全设置」,确认是否启用了额外安全项:
574+
1. **在飞书群聊中创建自定义机器人**:
575+
- 打开目标群聊 → 右上角「群设置」→「群机器人」→「添加机器人」→「自定义机器人」
576+
- 填写机器人名称,复制生成的 **Webhook URL**(格式:`https://open.feishu.cn/open-apis/bot/v2/hook/...`)
577+
2. 设置 `FEISHU_WEBHOOK_URL`(即上一步复制的 URL)。
578+
3. 查看机器人**安全设置**,根据启用的安全项决定是否需要补充配置:
577579
- **无额外安全设置**:仅填 `FEISHU_WEBHOOK_URL` 即可。
578580
- **开启了「签名校验」**:把飞书显示的 secret 填到 `FEISHU_WEBHOOK_SECRET`。两端必须同时启用或同时不填,否则飞书返回签名校验失败。
579-
- **开启了「关键词」**:把同一个关键词填到 `FEISHU_WEBHOOK_KEYWORD`;系统会自动在每条消息前补上。
581+
- **开启了「关键词」**:把同一个关键词填到 `FEISHU_WEBHOOK_KEYWORD`;系统会自动在每条消息前补上,无需手动修改报告模板。
582+
- **开启了 IP 白名单**:确保当前运行环境的出口 IP 在白名单中(本地/Docker/GitHub Actions 出口 IP 各不相同)。
580583
4. `FEISHU_APP_ID` / `FEISHU_APP_SECRET` 是飞书应用 / Stream Bot / 云文档模式专用,不会触发群 Webhook 推送,不要用它们替代 `FEISHU_WEBHOOK_URL`。
581584

582585
**常见失败原因:**
@@ -585,6 +588,7 @@ FEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your_hook_token
585588
- 飞书机器人开启了「关键词」,但本地没有同步配置 `FEISHU_WEBHOOK_KEYWORD`
586589
- 机器人没有被加入目标群,或群管理员限制了机器人发言
587590
- 飞书侧额外配置了 IP 白名单,但当前运行环境 IP 不在白名单中
591+
- 消息内容超长:飞书单条消息有长度限制,系统会自动分段发送;如需在一个文档内查看完整内容,可配置飞书云文档功能(`FEISHU_APP_ID` / `FEISHU_APP_SECRET` / `FEISHU_FOLDER_TOKEN`)
588592

589593
更完整的图文排查请看 [docs/bot/feishu-bot-config.md](bot/feishu-bot-config.md)。
590594
### Telegram

docs/full-guide_EN.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,20 +483,24 @@ FEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your_hook_token
483483

484484
**Step-by-step setup:**
485485

486-
1. Add a "Custom Bot" in the target Feishu group and copy its Webhook URL.
487-
2. Set `FEISHU_WEBHOOK_URL`. It usually looks like `https://open.feishu.cn/open-apis/bot/v2/hook/...`.
488-
3. Go back to the bot's **Security Settings** and check whether any extra security option is enabled:
486+
1. **Create a Custom Bot in the target Feishu group**:
487+
- Open the group → tap the settings icon (top right) → **Group Bots****Add Bot****Custom Bot**
488+
- Enter a name for the bot, then copy the generated **Webhook URL** (format: `https://open.feishu.cn/open-apis/bot/v2/hook/...`)
489+
2. Set `FEISHU_WEBHOOK_URL` to the URL you just copied.
490+
3. Check the bot's **Security Settings** and add the corresponding config if any extra option is enabled:
489491
- **No extra security**: only `FEISHU_WEBHOOK_URL` is needed.
490492
- **Signature verification enabled**: copy the secret shown in Feishu into `FEISHU_WEBHOOK_SECRET`. **Both sides must be enabled or disabled together** — if Feishu has signing on but `FEISHU_WEBHOOK_SECRET` is missing (or vice versa), every request will be rejected.
491-
- **Keyword enabled**: copy the exact same keyword into `FEISHU_WEBHOOK_KEYWORD`. The app will prepend it to every message automatically.
493+
- **Keyword enabled**: copy the exact same keyword into `FEISHU_WEBHOOK_KEYWORD`. The app will prepend it to every message automatically; no need to change report templates.
494+
- **IP allowlist enabled**: make sure the outbound IP of your runtime (local / Docker / GitHub Actions each have different IPs) is on the allowlist.
492495
4. `FEISHU_APP_ID` / `FEISHU_APP_SECRET` are for Feishu app / Stream Bot / cloud document flows only — they do **not** trigger group webhook notifications and must not be used instead of `FEISHU_WEBHOOK_URL`.
493496

494-
Common failure causes:
497+
**Common failure causes:**
495498
- Only `FEISHU_APP_ID` / `FEISHU_APP_SECRET` were set, but `FEISHU_WEBHOOK_URL` was not configured
496499
- The bot has Signature security enabled, but `FEISHU_WEBHOOK_SECRET` was not set locally (or was mistakenly set to `FEISHU_APP_SECRET`)
497500
- The bot has Keyword security enabled, but `FEISHU_WEBHOOK_KEYWORD` was not set locally
498501
- The bot was not added to the target group, or group permissions block it from posting
499502
- A Feishu IP allowlist is enabled and your runtime IP is not on the allowlist
503+
- Message content too long: Feishu has a per-message length limit; the system auto-segments messages. For full content in a single document, configure Feishu Cloud Document (`FEISHU_APP_ID` / `FEISHU_APP_SECRET` / `FEISHU_FOLDER_TOKEN`)
500504

501505
For a full illustrated troubleshooting guide, see [docs/bot/feishu-bot-config.md](bot/feishu-bot-config.md).
502506

0 commit comments

Comments
 (0)