Feishu Media Sender | 飞书媒体发送器
Upload images or videos to Feishu and send as media messages with in-chat preview/playback.
将图片或视频上传至飞书并以媒体消息发送,聊天中可直接预览/播放。
Quick Start
CODEBLOCK0
Arguments
| Param | Required | Description |
|---|
| INLINECODE0 | ✅ | Local file path (absolute) |
| INLINECODE1 |
optional | Target
chat_id or
open_id. Falls back to
OPENCLAW_CHAT_ID env var |
|
--receive-id-type | optional | Auto-detected from prefix:
oc_ → chat
id, ou_ → openid |
|
--type | optional |
image or
video. Auto-detected from file extension if omitted |
Supported Formats
Image: JPG, JPEG, PNG, WEBP, GIF, BMP, ICO, TIFF, HEIC (max 10 MB)
Video: MP4, MOV, AVI, MKV, WEBM (max 30 MB, uploaded as MP4)
How It Works
Images:
- 1. Upload via
/im/v1/images → get INLINECODE12 - Send message with
msg_type=image, content INLINECODE14
Videos:
- 1. Upload via
/im/v1/files (file_type=mp4) → get INLINECODE16 - Send message with
msg_type=media, content INLINECODE18
Credentials are auto-read from ~/.openclaw/openclaw.json.
API Reference
Feishu Media Sender | 飞书媒体发送器
Upload images or videos to Feishu and send as media messages with in-chat preview/playback.
将图片或视频上传至飞书并以媒体消息发送,聊天中可直接预览/播放。
Quick Start | 快速开始
bash
Send image (auto-detect) | 发送图片(自动检测)
python3 scripts/feishu
sendmedia.py --file photo.jpg --receive-id ou_xxx
Send video | 发送视频
python3 scripts/feishu
sendmedia.py --file video.mp4 --receive-id ou_xxx
Explicit type override | 显式指定类型
python3 scripts/feishu
sendmedia.py --file clip.gif --receive-id ou_xxx --type video
Arguments | 参数说明
| 参数 | 必填 | 描述 |
|---|
| --file | ✅ | 本地文件路径(绝对路径) |
| --receive-id |
可选 | 目标 chat
id 或 openid。若未指定,则回退使用 OPENCLAW
CHATID 环境变量 |
| --receive-id-type | 可选 | 根据前缀自动检测:oc
→ chatid,ou
→ openid |
| --type | 可选 | image 或 video。若省略,则根据文件扩展名自动检测 |
Supported Formats | 支持的格式
图片: JPG、JPEG、PNG、WEBP、GIF、BMP、ICO、TIFF、HEIC(最大 10 MB)
视频: MP4、MOV、AVI、MKV、WEBM(最大 30 MB,以 MP4 格式上传)
How It Works | 工作原理
图片:
- 1. 通过 /im/v1/images 上传 → 获取 imagekey
- 发送消息,msgtype=image,内容 {image_key: ...}
视频:
- 1. 通过 /im/v1/files 上传(filetype=mp4)→ 获取 filekey
- 发送消息,msgtype=media,内容 {filekey: ...}
凭证信息自动从 ~/.openclaw/openclaw.json 读取。
API Reference | API 参考