WeCom Channel
xopc connects to WeCom (Enterprise WeChat) AI Bot over its authenticated WebSocket protocol (wss://openws.work.weixin.qq.com). It supports QR onboarding, native msgtype: "stream" streaming replies, rich inbound/outbound media, multi-account bots, Realtime events, and Agent Tools.
Setup
Use Set up by QR in the xopc Console, or configure botId and secret in ~/.xopc/xopc.json (or WECOM_BOT_ID / WECOM_SECRET):
json
{
"channels": {
"wecom": {
"enabled": true,
"botId": "<BOT_ID>",
"secret": "<BOT_SECRET>",
"dmPolicy": "pairing",
"groupPolicy": "allowlist",
"groupAllowFrom": ["<USER_ID>"],
"streaming": {
"enabled": true,
"throttleMs": 500
}
}
}
}Capabilities
- Rich Inbound: Parses
text,image,file,voice(with transcript + audio download),mixed(interleaved text + images), and quoted messages (quote), saving accessible media attachments into xopc media storage. - Native Streaming: Uses
aibot_respond_msgwithmsgtype: "stream"(finish: falseincremental updates,finish: truefinalize) automatically when replying to an active turn. - Chunked Media Uploads: 3-step
aibot_upload_media_init/aibot_upload_media_chunk/aibot_upload_media_finishfor images, videos, voice, and files. - Multi-Account & Realtime: Supports
accounts.<id>, per-groupgroups.<chatid>rules,wecom.eventGateway Realtime events, and hot-reload.
Agent Tools
Registered automatically (gated by channels.wecom.actions.*):
wecom_send_message(Markdown or media)wecom_read_observed_messageswecom_connection_status