dadaniya99

feishu-send-file

Officev1.2.1
By dadaniya99Updated 2026-05-115 versions · latest released 2026-03-15@clawhub_dadaniya99/feishu-send-file
DocumentsProcess Automation#Feishu#Message#PDF#飞书

According to AlphaMoat, as of 2026-09, feishu-send-file has 3,994 downloads and 4 stars — ranked #2,566 of 5,078 AI skills overall, and #209 of 435 in Office.

Installs
268
Downloads
4.0K
Stars
4
Overall Rank
#2,566
Top 51% overall · Top 49% in Office
PlatformInstallsDownloadsStarsComments
ClawHub ↗1173.8K3-
SkillHub ↗2684.0K4—

Platforms count differently and update at different times.

What this skill does

Send files through Feishu; use the image-upload flow when a local image path is shown instead of the image.

Profile published 2026-10-27

What you can do with it

  • Organize the requested task and its output
  • Work from the user-provided topic or target
  • Call out source checks or execution status where relevant

When to use it

  • When you need to send files through Feishu; use the image-upload flow when a local image path is shown instead of the image
  • When you want to handle the related steps in one workflow

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Use the information I provide to send files through Feishu; use the image-upload flow when a local image path is shown instead of the image.
Tell me what input is needed, then provide the result or next steps.

Monthly Trend

Downloads4.0K
1.9K3.0K4.1K2026-03 · Downloads 2.1K2026-05 · Downloads 2.9K2026-06 · Downloads 3.1K2026-07 · Downloads 3.5K2026-08 · Downloads 3.7K2026-09 · Downloads 4.0K26-0326-09
Stars4
3442026-03 · Stars 32026-05 · Stars 32026-06 · Stars 32026-07 · Stars 42026-08 · Stars 42026-09 · Stars 426-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-094.0K—4
2026-083.7K+3.4%4
2026-073.5K+13.9%4
2026-063.1K+6.5%3
2026-052.9K—3
2026-032.1K—3

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

5.2 KB · ClawHub v1.2.1
---
name: feishu-send-file
description: 飞书发送文件技能。用于通过飞书向用户发送普通文件附件(HTML、ZIP、PDF、代码文件等)以及处理“本地图片路径被发成路径文本”的可靠补救场景。普通文件必须先上传获取 `file_key` 再发送;当本地图片用 `message`/`media` 发送后在飞书里只显示 `/root/...png` 路径而不显示图片时,改用本技能内的稳定图片上传脚本(`im/v1/images` -> `image_key` -> `msg_type=image`)。
---

# 飞书发送文件

飞书机器人发送普通文件(非图片/视频)需要两步:先上传文件获取 file_key,再用 file_key 发消息。

如果本地图片通过常规 `message` / `media` 路径发送后,用户在飞书里看到的是 `/root/...png` 路径文本而不是图片本体,不要继续重试同一种方式;直接改走本技能的**稳定图片上传脚本**。
Show all (139 lines)

## 快速流程

### 方式一:用脚本(推荐)

```bash
python3 scripts/send_file.py <file_path> <open_id> <app_id> <app_secret> [file_name]
```

**参数说明:**
- `file_path`: 要发送的文件路径(HTML/PDF/ZIP/代码文件等)
- `open_id`: 接收者的 open_id(从 inbound_meta 的 chat_id 字段获取,格式为 `user:ou_xxx`,取 `ou_xxx` 部分)
- `app_id`: 飞书应用 ID(从 `openclaw.json` 的 `channels.feishu.appId` 读取)
- `app_secret`: 飞书应用密钥(从 `openclaw.json` 的 `channels.feishu.appSecret` 读取)
- `file_name`: 可选,自定义文件名(不填则用原文件名)

**快速获取配置:**
```bash
# 获取 app_id 和 app_secret
grep -A 2 '"feishu"' /root/.openclaw/openclaw.json | grep -E '(appId|appSecret)'
```

**完整示例:**
```bash
python3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \
  /root/myfiles/report.html \
  <USER_OPEN_ID> \
  <YOUR_APP_ID> \
  <YOUR_APP_SECRET> \
  report.html
```

**AI 助手使用示例:**
```python
# 当需要发送文件给用户时,直接调用脚本
exec(f"""
python3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_file.py \\
  {file_path} \\
  {user_open_id} \\
  {app_id} \\
  {app_secret} \\
  {custom_filename}
""")
```

### 方式二:手动两步

**Step 1 - 上传文件:**
```bash
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d '{"app_id":"<APP_ID>","app_secret":"<APP_SECRET>"}' | python3 -c "import json,sys; print(json.load(sys.stdin)['tenant_access_token'])")

FILE_KEY=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file_type=stream" \
  -F "file_name=<文件名>" \
  -F "file=@<文件路径>" | python3 -c "import json,sys; print(json.load(sys.stdin)['data']['file_key'])")
```

**Step 2 - 发送消息:**
```bash
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"<OPEN_ID>\",\"msg_type\":\"file\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}"
```

## 稳定发送图片(2026-03-15 补充)

### 什么时候不要再硬用 `message` + `media`

如果你把本地图片路径(尤其是 `/root/myfiles/...`)传给飞书消息链路后,用户在飞书里看到的是:

- `📎 /root/myfiles/xxx.png`
- 或纯本地路径文本

那就说明这次**没有真正发成图片**。不要继续重试同一种参数组合。

### 原因(真实世界版)

- 飞书真正的图片消息不是“把本地路径塞给消息发送器”
- 正路是:**先上传到 `im/v1/images`,拿到 `image_key`,再发送 `msg_type=image`**
- OpenClaw / Feishu 插件在某些本地路径场景下(特别是 `/root/myfiles/...`)可能无法走通本地媒体上传链路,随后自动降级成把路径文本发出去
- 所以:`messageId` 返回成功 **不等于** 用户真的看到了图片

### 成功标准

**只有一个成功标准:用户在飞书里实际看到图片本体。**

如果回显的是路径文本,就视为失败。

### 推荐脚本(稳定版)

```bash
python3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> [domain]
```

示例:

```bash
python3 /root/.openclaw/workspace/skills/feishu-send-file/scripts/send_image.py \
  /root/myfiles/generated-images/demo.png \
  <USER_OPEN_ID> \
  <YOUR_APP_ID> \
  <YOUR_APP_SECRET>
```

如果是国际版 Lark:

```bash
python3 scripts/send_image.py <image_path> <open_id> <app_id> <app_secret> lark
```

### 这和普通文件的区别

- **普通文件**:`im/v1/files` -> `file_key` -> `msg_type=file`
- **图片**:`im/v1/images` -> `image_key` -> `msg_type=image`

这两条链路不要混用。

## 注意事项

- **普通文件**:必须走本技能的两步流程,直接用 `filePath` 参数只会显示路径
- **图片**:理论上 `message` tool 的 `media` 参数可以工作;但如果用户看到的是路径文本而不是图片本体,立刻改用 `scripts/send_image.py`
- **不要把 `/root/myfiles/...` 本地路径回显误判为发送成功**
- `receive_id_type=open_id` 对应个人用户;群聊用 `chat_id` 并替换类型
- 飞书 file_type 用 `stream` 适用于所有普通文件类型

Popular in Office

More from dadaniya99

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.