Install
openclaw skills install @torry21th/wechat-sendmediasend images and files to a wechat conversation through openclaw's wechat channel. use when the user asks to send a local image, send a screenshot, send a downloaded file, or send any media/file back to the current wechat chat or an optional recipient. optimized for openclaw builds where the gateway parses MEDIA:file:// tokens from plain text instead of json media envelopes.
openclaw skills install @torry21th/wechat-sendmediaUse this skill only for the openclaw-weixin channel.
For outbound media, prefer the plain-text MEDIA token format, not a JSON envelope.
Return the final assistant message as plain text like this:
发送成功
- 类型:图片 | 文件
- 路径:<absolute path>
- 接收人:当前会话 | <recipient>
MEDIA:file:///absolute/path/to/file.png
Why: newer OpenClaw gateway builds parse media only from text directives such as MEDIA:file:///.... If you return JSON like { "mediaUrl": "file:///..." }, the gateway may forward that JSON as plain text and no image/file will be delivered.
Do not rely on these formats as the primary output:
{
"text": "这是你要的图片",
"mediaUrl": "file:///tmp/x.png"
}
or:
{
"text": "...",
"mediaUrl": "MEDIA:file:///tmp/x.png"
}
These may be displayed to the user as literal text.
Handle these tasks:
发送成功 or 发送失败 plus actionable diagnostics.Interpret the request into:
file_path: absolute local path to an existing file, or a screenshot path produced earlier.recipient: optional. Default 当前会话.caption: optional short note for the human-readable confirmation text.source_kind: image or file.If the user asks for a screenshot first, obtain the screenshot file before sending.
Return plain text only:
发送成功
- 类型:图片
- 路径:/tmp/browser-shot.png
- 接收人:当前会话
MEDIA:file:///tmp/browser-shot.png
Rules:
MEDIA:file://... directive must be on its own line.图片 for common image types and 文件 for everything else.Return:
发送失败
- 可能原因:<one line summary>
- 建议:<next step>
调试信息:
- file_path: <path>
- exists: true|false
- recipient: <recipient>
- upload_url: <value or n/a>
- upload_url_host: <value or n/a>
- encrypted_param_length: <number or 0>
- sendmessage_status: <value or n/a>
- sendmessage_response: <raw text or n/a>
- context_token_present: true|false
- media_type_guess: image|file|unknown
scripts/emit_media_reply.py to validate the file and build the plain-text reply payload.reply_text value as the assistant message.scripts/weixin_debug_send.js to produce targeted diagnostics.Treat these as images by default:
.png, .jpg, .jpeg, .gif, .webp, .bmpTreat everything else as files.
发给我 and the current task came from WeChat, use 当前会话.recipient as 当前会话 in the confirmation text and let the host runtime map it to the current chat.When debugging an OpenClaw WeChat media failure, prefer concrete evidence over guesses.
Common causes to mention only when supported by the debug output:
MEDIA: token was present.x-encrypted-param missing or unexpectedly short.sendmessage returned empty body or non-success JSON.MEDIA:file://....Final reply:
发送成功
- 类型:图片
- 路径:/tmp/browser-shot.png
- 接收人:当前会话
MEDIA:file:///tmp/browser-shot.png
Final reply:
发送成功
- 类型:文件
- 路径:/Users/example/Desktop/report.pdf
- 接收人:当前会话
MEDIA:file:///Users/example/Desktop/report.pdf
scripts/emit_media_reply.py to validate a path and build reply_text.scripts/weixin_debug_send.js to collect failure diagnostics.references/openclaw-weixin-notes.md for compatibility notes.