Skip to content

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

KeyTypeDefaultDescription
enabledbooleanfalseEnable the WeChat channel
serverUrlstringagent-wechat REST API URL
tokenstringAuth token (auto-read from ~/.config/agent-wechat/token for local setups)
dmPolicy"open" | "allowlist" | "disabled""disabled"Who can DM the bot
allowFromstring[][]wxid allowlist for DMs (when policy is allowlist)
groupPolicy"open" | "allowlist" | "disabled""disabled"Group message policy
groupAllowFromstring[][]Global allowlist of group sender IDs
groupsobject{}Per-group overrides (see below)
pollIntervalMsinteger1000Message polling interval (ms)
authPollIntervalMsinteger30000Auth status check interval (ms)

DM policies

  • open — anyone can DM the bot
  • allowlist — only wxids in allowFrom can DM the bot
  • disabled — the bot ignores all DMs

Group policies

  • open — the bot responds in all group chats
  • allowlist — the bot only responds to senders in groupAllowFrom
  • disabled — 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"]
}
}
}
KeyTypeDescription
enabledbooleanEnable/disable the bot in this group
requireMentionbooleanWhether the bot must be @mentioned to respond
groupPolicystringOverride the global group policy for this group
allowFromstring[]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.