with one click
wecom-app-ops
// 企业微信自建应用(wecom-app)运维与使用技能包。用于:定位并回发图片/语音/文件;使用 saved: 稳定路径做 OCR/MCP/二次处理;规范 target(wecom-app:user:xxx / user:xxx / 裸ID / @accountId);排查发送失败;配置入站媒体保留策略与语音转码策略。
// 企业微信自建应用(wecom-app)运维与使用技能包。用于:定位并回发图片/语音/文件;使用 saved: 稳定路径做 OCR/MCP/二次处理;规范 target(wecom-app:user:xxx / user:xxx / 裸ID / @accountId);排查发送失败;配置入站媒体保留策略与语音转码策略。
| name | wecom-app-ops |
| description | 企业微信自建应用(wecom-app)运维与使用技能包。用于:定位并回发图片/语音/文件;使用 saved: 稳定路径做 OCR/MCP/二次处理;规范 target(wecom-app:user:xxx / user:xxx / 裸ID / @accountId);排查发送失败;配置入站媒体保留策略与语音转码策略。 |
本技能针对你这套 OpenClaw + 企业微信自建应用(wecom-app)环境,提供可复用的“怎么做”步骤。
target(通常 user:<name>)saved:/.../inbound/YYYY-MM-DD/... 的稳定路径inboundMedia.keepDays/dir/maxBytes.amr/.speex,或开启 voiceTranscode.enabled使用 message.send 向 wecom-app 主动发消息时,必须提供可解析 target(否则会报 Action send requires a target.)。
常见可用形式(以本环境为准):
target: "wecom-app:user:<userId>"target: "user:<userId>"target: "<userId>"(裸 ID,插件会按用户 ID 处理)target: "user:<userId>@<accountId>"(多账号场景)注意:当前 wecom-app 出站实现以用户私聊为主,运维侧不要依赖
chatid:<id>作为通用 target 格式。
message_id 作为 replyTo。replyTo 不是 target;target 仍然要填。CaiHongYu)不一定能被解析。target: "user:CaiHongYu"若仍报 Unknown target:
user:<userId>(推荐)userId/chatId:
~/.openclaw/logs/)target: "user:<userId>"(或 wecom-app:user:<userId>)wecom-app 现在会把入站媒体归档到:
inboundMedia.dir/YYYY-MM-DD/~/.openclaw/media/wecom-app/inbound/YYYY-MM-DD/消息正文会出现:
[image] saved:/.../inbound/YYYY-MM-DD/img_...jpg[voice] saved:/.../inbound/YYYY-MM-DD/voice_...amr这条 saved 路径用于:OCR、回发、复用。
/tmp/wecom-app-media/ 只作为下载中转,不保证长期存在。使用 message 工具:
channel: "wecom-app"target: "user:<name>"path: "<本地文件路径>"replyTo: "<message_id>"(可选但推荐)格式要求(踩坑高发):
.png / .jpg / .jpeg.svg 在企业微信里通常不会按“图片消息”展示。
.svg 按文件发送,避免误走图片通道。rsvg-convert / ImageMagick convert / 或用脚本生成 PNG 兜底)。.amr(你收到的入站语音也通常是 amr).wav/.mp3 在企业微信自建应用里经常无法作为“语音消息(voice)”发送。自动兜底(新功能)
voiceTranscode.enabled=true:
ffmpeg 时:遇到 wav/mp3 会 自动转码为 amr 再按 voice 发送ffmpeg 时:会 自动降级为 file 发送(保证可达)mediaUrl 是远程 URL,当前实现会直接走 file 降级(不做“下载后再转码”)配置示例(openclaw.json):
{
"channels": {
"wecom-app": {
"voiceTranscode": {
"enabled": true,
"prefer": "amr"
}
}
}
}
手动转码示例(ffmpeg)
ffmpeg -i in.wav -ar 8000 -ac 1 -c:a amr_nb out.amr
/tmp/xxx.md)message.send 的 path 作为附件发送。Action send requires a targettarget:"user:..."。Unknown target / 发送 ok=falseuser:<name> vs 内部 id)。wecom-app:user:<id> / user:<id> / <id> 三种格式。@accountId,例如:user:alice@default。Account not configured for active sendingcorpId / corpSecret / agentId 任一项时会出现。inboundMedia.keepDays:默认 7 天(延迟清理,不会“回复后立刻删”)inboundMedia.dir:可自定义归档目录inboundMedia.maxBytes:单个媒体大小限制(默认 10MB)要修改:编辑 openclaw.json 的 channels.wecom-app.inboundMedia。
可复制模板:
{
"channels": {
"wecom-app": {
"inboundMedia": {
"enabled": true,
"keepDays": 7,
"maxBytes": 10485760
}
}
}
}
stripMarkdown)。当用户说“记得调用 mcp 识别图片”,用 mcporter 调用:
zai-mcp-server.extract_text_from_screenshot(image_source: <saved-path>, prompt: <说明>)前提:必须拿到真实存在的文件路径(建议用 inbound saved 路径)。
references/wecom-app-examples.md当用户提到企业微信文档、智能表格、创建文档、编辑文档、写文档时启用。优先复用 wecom channel 自动写入的文档 MCP 配置,并通过 mcporter 调用文档能力。
Resolve a QQBot recipient from the local known-targets registry, distinguish between similarly named contacts, and send text or files to the intended QQ user with the correct target. Use whenever the user says things like “发给这个 QQ 联系人”, “把这个文件发给某个 QQ 用户”, “看看 known-targets.json 里是谁”, “确认发送对象”, or when you need to map a human-readable QQ contact name to a concrete `user:<openid>` target before sending. Prefer this skill over guessing from the current chat when multiple QQ users exist.