OpenClaw Configuration
All configuration lives under channels.wechat in OpenClaw’s config file (~/.openclaw/openclaw.json).
Full example
{ "channels": { "wechat": { "enabled": true, "serverUrl": "http://localhost:6174", "token": "your-auth-token", "dmPolicy": "open", "groupPolicy": "allowlist", "groupAllowFrom": ["wxid_trusted_user"], "groups": { "12345@chatroom": { "enabled": true, "requireMention": false, "groupPolicy": "allowlist", "allowFrom": ["wxid_specific_user"] } }, "pollIntervalMs": 1000, "authPollIntervalMs": 30000 } }}Configuration reference
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable the WeChat channel |
serverUrl | string | — | agent-wechat REST API URL |
token | string | — | Auth token (auto-read from ~/.config/agent-wechat/token for local setups) |
dmPolicy | "open" | "allowlist" | "disabled" | "disabled" | Who can DM the bot |
allowFrom | string[] | [] | wxid allowlist for DMs (when policy is allowlist) |
groupPolicy | "open" | "allowlist" | "disabled" | "disabled" | Group message policy |
groupAllowFrom | string[] | [] | Global allowlist of group sender IDs |
groups | object | {} | Per-group overrides (see below) |
pollIntervalMs | integer | 1000 | Message polling interval (ms) |
authPollIntervalMs | integer | 30000 | Auth status check interval (ms) |
DM policies
open— anyone can DM the botallowlist— only wxids inallowFromcan DM the botdisabled— the bot ignores all DMs
Group policies
open— the bot responds in all group chatsallowlist— the bot only responds to senders ingroupAllowFromdisabled— the bot ignores all group messages
Per-group overrides
You can override settings for specific groups:
{ "groups": { "12345@chatroom": { "enabled": true, "requireMention": false, "groupPolicy": "allowlist", "allowFrom": ["wxid_user1", "wxid_user2"] } }}| Key | Type | Description |
|---|---|---|
enabled | boolean | Enable/disable the bot in this group |
requireMention | boolean | Whether the bot must be @mentioned to respond |
groupPolicy | string | Override the global group policy for this group |
allowFrom | string[] | Group-specific sender allowlist |
Token handling
For local setups, the token is automatically read from ~/.config/agent-wechat/token (shared with the CLI and container). When connecting to a remote server, add the token field to the config.