Install
openclaw skills install feishu-axiang-send-image使用自有飞书应用配置,上传并发送本地图片到指定飞书用户或群聊,支持PNG/JPG/GIF/WEBP格式。
openclaw skills install feishu-axiang-send-image飞书图片发送技能,使用自有飞书应用配置发送图片到飞书聊天(个人或群聊)。
特点:
飞书应用信息(硬编码在脚本中):
{
"appId": "cli_XXX",
"appSecret": "XXX",
"accountId": "XXX"
}
允许发送的用户:
feishu-axiang-allowFrom.json 中配置允许的用户列表两步法:
im/v1/images API 上传图片到飞书 → 获取 image_keyim/v1/messages API 发送图片消息 → 获取 message_id# 发送图片到个人(默认)
python scripts/send.py --file-path "C:\path\to\image.png"
# 发送到指定用户
python scripts/send.py --file-path "C:\path\to\image.png" --target "ou_xxxxx"
# 发送到群聊
python scripts/send.py --file-path "C:\path\to\image.png" --target "oc_xxxxx" --target-type chat_id
from scripts.send import send_image_to_feishu
# 发送到默认用户
result = send_image_to_feishu("image.png")
# 发送到指定用户
result = send_image_to_feishu("image.png", target="ou_xxxxx", target_type="open_id")
| 参数 | 必需 | 默认值 | 说明 |
|---|---|---|---|
--file-path | ✅ | - | 本地图片文件路径 |
--target | ❌ | 配置中的默认值 | 目标用户 open_id 或群聊 chat_id |
--target-type | ❌ | open_id | 目标类型(open_id/chat_id) |
Image Sender
File: C:\Users\your_username\.openclaw\workspace\image.png
Target: ou_xxxxx (open_id)
App: cli_XXX (accountId)
Step 1: Get tenant_access_token
OK Token obtained
Step 2: Upload image to Feishu
OK Upload success, image_key: img_v3_xxx
Step 3: Send image message
OK Send success, message_id: om_xxx
Image sent successfully!
| 格式 | 支持 | 说明 |
|---|---|---|
| PNG | ✅ | 推荐格式 |
| JPG/JPEG | ✅ | 支持 |
| GIF | ✅ | 支持(会自动转换) |
| WEBP | ✅ | 支持 |
原因: 目标用户不在允许列表中
解决:
feishu-axiang-allowFrom.json 中添加用户原因: 图片路径不存在
解决: 检查文件路径是否正确,使用绝对路径
原因: AppID 或 AppSecret 错误
解决: 检查脚本中的配置是否正确
scripts/send.py - 主发送脚本feishu-axiang-allowFrom.json - 允许发送的用户列表(需自行配置)编辑 scripts/send.py,填入你自己的飞书应用配置:
app_id: 你的飞书应用 AppIDapp_secret: 你的飞书应用 AppSecretdefault_target: 默认发送目标用户创建 feishu-axiang-allowFrom.json 文件,配置允许发送的用户列表
⚠️ 安全提示: