Feishu File Sender
Send files to Feishu/Lark users and chat groups with proper formatting and error handling.
When to Use
Use this skill when:
- - User wants to send a file via Feishu
- Need to deliver documents, images, PDFs to Feishu contacts
- Transferring generated files (reports, exports, etc.) to Feishu
- Sharing any file through Feishu messaging
Quick Start
CODEBLOCK0
File Types Supported
- - Documents:
.pdf, .doc, .docx, .txt, INLINECODE4 - Spreadsheets:
.xls, .xlsx, INLINECODE7 - Images:
.jpg, .jpeg, .png, .gif, INLINECODE12 - Archives:
.zip, .rar, INLINECODE15 - Code files:
.py, .js, .html, .json, etc.
Usage Examples
Send a Single File
CODEBLOCK1
Send with Caption
CODEBLOCK2
Send Multiple Files
Send files one by one with context:
CODEBLOCK3
Send to Specific Target
CODEBLOCK4
Best Practices
- 1. Always verify file exists before sending
- Provide context with the message parameter when helpful
- Check file size - Feishu has limits (typically 100MB-1GB depending on plan)
- Use absolute paths to avoid confusion
Common Patterns
After Generating a File
CODEBLOCK5
Batch File Delivery
CODEBLOCK6
Error Handling
Common issues and solutions:
| Error | Cause | Solution |
|---|
| File not found | Wrong path | Use absolute path with INLINECODE20 |
| Access denied |
Permissions | Check file permissions with
ls -la |
| Too large | File size limit | Compress or split file |
| Channel error | Feishu config | Verify channel is properly configured |
Tool Reference
message tool (action=send)
CODEBLOCK7
Related Skills
- -
auto-file-sender - Automatic file sending when files are generated - INLINECODE23 - Large file transfer via Feishu API
Version: 1.0
Compatible with: OpenClaw v1.x+
Platform: Feishu / Lark
飞书文件发送器
向飞书/Lark用户和聊天群组发送文件,具备完善的格式处理和错误处理功能。
使用场景
在以下情况下使用此技能:
- - 用户希望通过飞书发送文件
- 需要向飞书联系人传递文档、图片、PDF文件
- 将生成的文件(报告、导出文件等)传输到飞书
- 通过飞书消息分享任何文件
快速开始
python
基本文件发送
message action=send filePath=/path/to/file.pdf
附带自定义消息
message action=send filePath=/path/to/report.docx message=这是您要的报告
支持的文件类型
- - 文档:.pdf、.doc、.docx、.txt、.md
- 电子表格:.xls、.xlsx、.csv
- 图片:.jpg、.jpeg、.png、.gif、.webp
- 压缩包:.zip、.rar、.tar.gz
- 代码文件:.py、.js、.html、.json等
使用示例
发送单个文件
python
message action=send filePath=/workspace/report.pdf
附带说明发送
python
message action=send filePath=/workspace/data.xlsx message=第四季度销售数据
发送多个文件
逐个发送文件并附带上下文:
python
for file in files:
message action=send filePath=file
发送到指定目标
python
发送给特定用户
message action=send target=user:ou_xxx filePath=/path/to/file
发送到特定聊天群
message action=send target=chat:oc_xxx filePath=/path/to/file
最佳实践
- 1. 发送前务必验证文件是否存在
- 在需要时使用message参数提供上下文
- 检查文件大小 - 飞书有大小限制(根据套餐通常为100MB-1GB)
- 使用绝对路径以避免混淆
常见模式
生成文件后发送
python
生成报告
exec command=python generate_report.py
发送给用户
message action=send filePath=/workspace/output/report.pdf message=您的报告已准备就绪
批量文件投递
python
收集所有生成的文件
files = [/workspace/file1.pdf, /workspace/file2.xlsx]
for i, file in enumerate(files, 1):
message action=send filePath=file message=f第{i}个文件,共{len(files)}个
错误处理
常见问题及解决方案:
| 错误 | 原因 | 解决方案 |
|---|
| 文件未找到 | 路径错误 | 使用filePath指定绝对路径 |
| 访问被拒绝 |
权限问题 | 使用ls -la检查文件权限 |
| 文件过大 | 超出大小限制 | 压缩或拆分文件 |
| 频道错误 | 飞书配置问题 | 确认频道配置正确 |
工具参考
message工具(action=send)
yaml
action: send
filePath: /absolute/path/to/file # 必填:文件路径
message: 可选说明文字 # 可选:附带消息
target: user:xxx 或 chat:xxx # 可选:指定接收者
channel: feishu # 可选:默认为当前频道
相关技能
- - auto-file-sender - 文件生成时自动发送
- feishu-file-transfer - 通过飞书API传输大文件
版本:1.0
兼容:OpenClaw v1.x+
平台:飞书 / Lark