Disable Group Chats or Configure an Allowlist for OpenClaw IM Bots
Procedure
Storing token values directly in environment variables or configuration files poses a risk of sensitive information leakage. To mitigate this risk, encrypt and store sensitive data instead of using plain text, and rotate tokens periodically.
- Method 1
- Disable WeCom group chat.
openclaw config set channels.wecom.groupPolicy "disabled"
- Disable group chat for the QQ bot.
openclaw config set channels.qqbot.groupPolicy "disabled"
- Disable Feishu group chats.
openclaw config set channels.feishu.groupPolicy "disabled"
- (Optional) Configure the private chat allowlist.
openclaw config set channels.wecom.dmPolicy "allowlist" openclaw config set channels.wecom.allowFrom '["123456789"]' --json openclaw config set channels.qqbot.dmPolicy "allowlist" openclaw config set channels.qqbot.allowFrom '["123456789"]' --json openclaw config set channels.feishu.dmPolicy "allowlist" openclaw config set channels.feishu.allowFrom '["123456789"]' --json
Replace 123456789 with the actual user ID to be allowed.
- Verify the configuration.
openclaw config get channels
- Restart the OpenClaw gateway.
openclaw gateway restart
- Disable WeCom group chat.
- Method 2
- Open the configuration file.
vim ~/.openclaw/openclaw.json
- Press i to enter the insert mode and configure groupPolicy to disable group chats or enable the allowlist.
Reference solution: Disable group chats.
{ "channels": { "wecom": { "enabled": true, "token": "your-stride-token", "dmPolicy": "allowlist", "groupPolicy": "disabled", "allowFrom": ["WeCom_ID_of_the_allowed_private_chat_user"] }, "qqbot": { "enabled": true, "appId": "YOUR_APP_ID", "clientSecret": "YOUR_APP_SECRET", "dmPolicy": "allowlist", "groupPolicy": "disabled" "allowFrom": ["QQ_number_of_the_allowed_user"] }, "feishu": { "enabled": true, "appId": "cli_xxxxx", "dmPolicy": "allowlist", "groupPolicy": "disabled", "allowFrom": ["Feishu_user_ID_of_the_allowed_user"] } } } - Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Restart the OpenClaw gateway.
openclaw gateway restart
- Open the configuration file.
Parent topic: Manual Configuration Items