Skip to content

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_msg with msgtype: "stream" (finish: false incremental updates, finish: true finalize) automatically when replying to an active turn.
  • Chunked Media Uploads: 3-step aibot_upload_media_init / aibot_upload_media_chunk / aibot_upload_media_finish for images, videos, voice, and files.
  • Multi-Account & Realtime: Supports accounts.<id>, per-group groups.<chatid> rules, wecom.event Gateway Realtime events, and hot-reload.

Agent Tools ​

Registered automatically (gated by channels.wecom.actions.*):

  • wecom_send_message (Markdown or media)
  • wecom_read_observed_messages
  • wecom_connection_status

Released under the MIT License.