通过飞书 API 发送图片消息。支持发送本地图片文件给指定用户或群聊。
在飞书(或其他渠道)的 OpenClaw 对话框中直接说:
text
安装 leo-feishu-send-image skill
或
text
帮我装一下 leo-feishu-send-image
OpenClaw 会自动从 ClawHub 下载并安装 skill。
bash
clawhub install leo-feishu-send-image
在 ~/.openclaw/openclaw.json 中添加飞书应用配置:
json
{
"channels": {
"feishu": {
"accounts": {
"default": {
"appId": "cli_xxxxxxxxxxxxxxxx",
"appSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
}
如何获取 App ID 和 App Secret:
App ID 和 App Secretim:chat:readonly 和 im:message:send_as_bot 权限需要 jq 工具处理 JSON:
bash
# Ubuntu/Debian
sudo apt-get install jq
# CentOS/RHEL
sudo yum install jq
# macOS
brew install jq
安装 skill 后,直接在对话框中说:
text
用飞书发图 skill 发送 /path/to/image.jpg 给 ou_xxxxxxxx
或
text
用 leo-feishu-send-image 发图给 ou_xxxxxxxx
或
text
飞书发送图片 /path/to/image.jpg 给 ou_xxxxxxxx
参数说明:
/path/to/image.jpg - 本地图片文件路径ou_xxxxxxxx - 接收者的 open_id(用户)或 oc_xxxxxxxx(群聊)bash
# 进入 skill 目录
cd ~/.openclaw/workspace/skills/leo-feishu-send-image
# 基本用法
./scripts/send-image.sh <图片路径> <接收者ID>
# 指定账户
./scripts/send-image.sh <图片路径> <接收者ID> <账户ID>
示例:
bash
# 发送给用户
./scripts/send-image.sh ./output.jpg ou_114db42b481a66952fceb246da9c7bd7
# 发送到群聊
./scripts/send-image.sh ./output.jpg oc_e4bc81fe9899665019af2cccaa7bb30d
# 使用指定账户(如果配置了多个账户)
./scripts/send-image.sh ./output.jpg ou_xxxxxxxx prompt
text
用户:用即梦生成一张风景图,然后发给我
OpenClaw:
1. 调用即梦 skill 生成图片
2. 保存到 workspace
3. 调用 leo-feishu-send-image 发送图片给用户
text
用户:把这 5 张图都发给我
OpenClaw:
for i in 1 2 3 4 5; do
./scripts/send-image.sh ./image_$i.jpg ou_xxxxxxxx
done
text
用户:把这张图发到游戏开发群
OpenClaw:
./scripts/send-image.sh ./design.png oc_xxxxxxxx
本 skill 底层调用飞书开放平台的三个 API:
POST /auth/v3/tenant_access_token/internalPOST /im/v1/imagesPOST /im/v1/messagesjq tojson 转换)错误信息可能原因解决方法缺少 app_id飞书配置未找到检查 ~/.openclaw/openclaw.json 中的 channels.feishu.accounts 配置获取 token 失败App ID / Secret 错误确认应用凭证正确,且应用已启用上传失败图片格式不支持转换为 JPEG/PNG 格式后重试发送失败接收者 ID 错误确认 open_id 或 chat_id 正确,且机器人有权限发送给该用户/群聊未安装 jq缺少依赖工具执行 sudo apt-get install jq 或对应系统的安装命令
contact:user.read 权限im.chat.list API 获取作者: @leo-jiqimao
ClawHub: https://clawhub.com/skills/leo-feishu-send-image
问题反馈: 请在 ClawHub 页面提交 issue