背景

Agent 模式的 MEDIA: directive 在 openclaw-weixin 渠道上只支持图片,不支持其他格式文件(.md、.pdf、.zip 等)。

解法:openclaw message send CLI 命令直接发文件,不走 agent 的 MEDIA 解析链路。

命令

openclaw message send \
  --channel openclaw-weixin \
  --account <accountId> \
  --target "<微信会话ID>" \
  --media /path/to/file \
  --message "说明文字"

参数说明

参数说明获取方式
--channel固定 openclaw-weixin-
--accountWeChat 插件的 accountIdopenclaw.json 配置的 channels.openclaw-weixin.accountId 获取
--target微信会话 ID从会话上下文的 deliveryContext.to 获取(格式如 xxxxxxxxxxx@im.wechat
--media要发送的文件路径本地绝对路径
--message文件附带说明文字可选

示例

openclaw message send \
  --channel openclaw-weixin \
  --account <你的accountId> \
  --target "<微信会话ID>" \
  --media /path/to/file \
  --message "说明文字"

注意事项

  1. 插件加载需要 30s+exec 执行时 timeout 要设够长(>60s)
  2. 如果命令被 SIGTERM/SIGKILL 中断,不一定是失败——先检查日志是否有 ✅ Sent via openclaw-weixin
  3. 不要因为看起来 "没反应" 就重复执行,避免多发
  4. 图片仍然建议用 MEDIA: directive 发送(微信原生支持)
  5. 该命令不走 agent 推理流程,零 token 消耗

标签: openclaw

添加新评论