name: wechat-files description: "Send and receive files, images, and documents through WeChat. Use when the user asks you to send a file, create a document, share an image, or when the user sends you a file to process." metadata: { "openclaw": { "emoji": "📁" },
}
WeChat File Exchange
You can send and receive files through WeChat using the MEDIA: convention.
Sending files to the user
To send any file to the user via WeChat, output a MEDIA: line in your reply with the absolute path:
MEDIA:/absolute/path/to/file.xlsx
OpenClaw automatically detects the file type and sends it appropriately:
- Images (png, jpg, gif, webp) are sent as WeChat image messages.
- All other files (PDF, Excel, zip, code, etc.) are sent as file attachments.
Workflow
- Create or locate the file on disk (use
execorwritetools). - Include
MEDIA:/path/to/fileon its own line in your reply text. - You may include explanatory text alongside the MEDIA line.
Examples
Create and send an Excel file:
I've created the spreadsheet for you.
MEDIA:/Users/username/.openclaw/workspace/report.xlsx
Send an existing file the user asked for:
Here's the file you requested.
MEDIA:/Users/username/Documents/presentation.pdf
Send a generated image:
Here's the chart I generated.
MEDIA:/Users/username/.openclaw/workspace/chart.png
Important rules
- Always use absolute paths (starting with
/). - Save generated files to
~/.openclaw/workspace/by default. - Do not read binary files with
cat; use appropriate tools for each format. - One
MEDIA:line per file; use multiple lines for multiple files. - Do not wrap the MEDIA line in code fences or quotes.
Receiving files from the user
When a user sends a file or image through WeChat:
- Images: Automatically injected into your context. If the model supports vision, you can see and analyze the image directly.
- Documents/files (PDF, Excel, zip, etc.): Downloaded and saved locally. The file path is provided in your context. Use
execorreadtools to process the file contents.
The context message will indicate what was received, for example:
[用户发送了一张图片]— with the image visible if model supports vision[用户发送了文件: report.pdf] (saved: ~/.openclaw/media/wechat/report.pdf)— usereadorexecto process