WeCom (WeChat Work)
Connect your GolemBot assistant to WeCom using the official AI Bot SDK with WebSocket. No public IP required.
Prerequisites
bash
pnpm add @wecom/aibot-node-sdkWeCom Admin Setup
- Go to WeCom Admin Console → App Management → create a new AI Bot
- Note down the Bot ID and Secret
- The SDK uses WebSocket — no callback URL configuration needed
Configuration
yaml
# golem.yaml
channels:
wecom:
botId: ${WECOM_BOT_ID}
secret: ${WECOM_SECRET}
# websocketUrl: wss://custom-endpoint # optional, for private deploymentssh
# .env
WECOM_BOT_ID=xxxxxxxxxx
WECOM_SECRET=xxxxxxxxxxxxxxxxxxHow It Works
- Transport: WebSocket long-connection via
@wecom/aibot-node-sdk - Connection: The SDK establishes and maintains a WebSocket connection to WeCom servers
- Reconnection: Automatic reconnection and heartbeat are handled by the SDK
- Messages: Incoming messages are received via WebSocket events and emitted as
ChannelMessage(text only) - Reply: Sends messages via the SDK's built-in reply method
- Proactive messaging:
send()is supported — the adapter can proactively send messages to any chat - Chat type: Always
dm(WeCom bot messages are direct messages)
Start
bash
golembot gateway --verboseThe adapter connects to WeCom via WebSocket automatically. No port forwarding or public IP needed.
Notes
- Like Feishu and DingTalk, WeCom now uses WebSocket — no public IP or reverse proxy required
- The
@wecom/aibot-node-sdkhandles reconnection and heartbeat automatically - The max message length is 2,048 characters; longer responses are automatically split
- Only text messages are processed