Install
openclaw skills install feishu-send-file-1-2-1通过飞书机器人稳定发送本地普通文件或本地图片。用于现有一等工具无法直接完成“发送本地文件附件”时,或本地图片经常规消息链路发送后在飞书里只显示路径文本而不显示图片本体时。普通文件走 `im/v1/files -> file_key -> msg_type=file`,图片走 `im/v1/images -> image_key -> msg_type=image`。
openclaw skills install feishu-send-file-1-2-1使用这个 skill 发送本地普通文件,或补救“本地图片被错误发成路径文本”的场景。
优先使用平台已有的一等飞书工具。只有在以下情况出现时,再使用本 skill:
飞书普通文件消息需要两步:
im/v1/filesfile_key 发送 msg_type=file飞书图片消息也需要两步:
im/v1/imagesimage_key 发送 msg_type=image不要混用这两条链路。
如果本地图片通过常规消息路径发送后,用户在飞书里看到的是:
/path/to/demo.png就视为这次发送失败,不要继续重试同一种方式,直接改用 scripts/send_image.py。
成功标准只有一个:用户在飞书里实际看到文件附件或图片本体。
python3 scripts/send_file.py <file_path> <receive_id_type> <receive_id> <app_id> <app_secret> [file_name] [domain]
参数:
file_path: 本地文件路径receive_id_type: open_id 或 chat_idreceive_id: 接收者 IDapp_id: 飞书或 Lark 应用 IDapp_secret: 飞书或 Lark 应用密钥file_name: 可选,自定义显示文件名domain: 可选,feishu 或 lark,默认 feishu示例:
python3 scripts/send_file.py /path/to/report.html open_id ou_xxx cli_xxx secret_xxx
python3 scripts/send_file.py /path/to/archive.zip chat_id oc_xxx cli_xxx secret_xxx backup.zip
python3 scripts/send_file.py /path/to/report.pdf open_id ou_xxx cli_xxx secret_xxx report.pdf lark
python3 scripts/send_image.py <image_path> <receive_id_type> <receive_id> <app_id> <app_secret> [domain]
参数:
image_path: 本地图片路径receive_id_type: open_id 或 chat_idreceive_id: 接收者 IDapp_id: 飞书或 Lark 应用 IDapp_secret: 飞书或 Lark 应用密钥domain: 可选,feishu 或 lark,默认 feishu示例:
python3 scripts/send_image.py /path/to/demo.png open_id ou_xxx cli_xxx secret_xxx
python3 scripts/send_image.py /path/to/demo.png chat_id oc_xxx cli_xxx secret_xxx lark
app_id / app_secret 来自当前飞书或 Lark 应用配置receive_id_type 取决于目标是私聊还是群聊receive_id 需要从当前消息上下文、用户映射、会话元数据或上游系统明确取得user:ou_xxx 之类的复合格式,先提取真正的 ID 再传给脚本不要把某个环境里的固定路径、固定配置文件位置、固定 inbound 字段格式写死为通用规则。
im/v1/files 上传文件file_key 发送 msg_type=fileim/v1/images 上传图片image_key 发送 msg_type=imagemessage_id,也不能直接判定成功,仍要看飞书客户端最终显示结果chat_idlark