This skill enables automatic file delivery from the workspace to Feishu/Lark users. When files are generated (documents, PDFs, images, etc.), they can be automatically sent to specified recipients without manual intervention.
Key Capabilities:
When a file is ready to send:
javascript
// Single file
{
"action": "send",
"filePath": "/root/.openclaw/workspace/document.docx",
"filename": "document.docx",
"message": "Here's your file!",
"target": "user_open_id"
}
The skill provides a helper script to watch for new files and auto-send:
bash
# Watch workspace and auto-send new files
python3 scripts/auto_send.py --watch /root/.openclaw/workspace --recipient USER_OPEN_ID
Check for recently created/modified files:
bash
# List files created in last 10 minutes
find /root/.openclaw/workspace -type f -mmin -10
Use the message tool with filePath parameter:
javascript
{
"action": "send",
"filePath": "<absolute-path-to-file>",
"filename": "<display-filename>",
"message": "<optional-message>",
"target": "<recipient-open-id>"
}
Parameters:
filePath: Absolute path to the file (required)filename: Display name for the file (optional, defaults to basename)message: Accompanying text message (optional)target: Recipient open_id (defaults to current user if omitted)Check the response for successful delivery:
messageId: ID of the sent messagechatId: ID of the chat/channelTypeExtensionsMax SizeDocuments.docx, .doc, .pdf30MBImages.jpg, .png, .gif, .webp30MBSpreadsheets.xlsx, .xls, .csv30MBArchives.zip, .tar.gz30MBOthersAny30MB
To send multiple files at once:
javascript
// Send files sequentially
for (const file of files) {
await message.send({
action: "send",
filePath: file.path,
filename: file.name
});
}
/root/.openclaw/workspaceTo send to a specific user:
javascript
{
"action": "send",
"target": "ou_a65105519c863f8544fb22b40c468063", // User's open_id
"filePath": "/path/to/file"
}
Python script for watching directories and auto-sending files.
Usage:
bash
python3 scripts/auto_send.py [options]
Options:
--watch PATH Directory to watch (default: workspace)
--recipient ID Target recipient open_id
--pattern PATTERN File pattern to match (default: *)
--once Send existing files and exit (don't watch)
Examples:
bash
# Watch and auto-send all new PDFs
python3 scripts/auto_send.py --pattern "*.pdf" --recipient USER_ID
# One-time send of all docx files
python3 scripts/auto_send.py --pattern "*.docx" --once
ls -la <filepath>For files > 30MB:
zip -r output.zip large_filesplit -b 25M large_file part_User: "Generate a report and send it to me"
javascript
// After generating the report
{
"action": "send",
"filePath": "/root/.openclaw/workspace/report_2024.docx",
"filename": "Annual_Report_2024.docx",
"message": "Here's your annual report!"
}
User: "Send all the PDFs in my workspace"
bash
# Find and send all PDFs
find /root/.openclaw/workspace -name "*.pdf" -exec \
python3 -c "import sys; print(sys.argv[1])" {} \;
Then send each file using the message tool.
After a long-running task generates output:
javascript
// Task completed, auto-send result
{
"action": "send",
"filePath": "/root/.openclaw/workspace/output.pdf",
"message": "Task completed! Here's your file."
}