#Help filtering whatsapp messages.
1 messages · Page 1 of 1 (latest)
Yes, for WhatsApp groups you can do this before the AI runs with mention gating plus mentionPatterns.
{
channels: {
whatsapp: {
groups: {
"*": { requireMention: true },
},
},
},
agents: {
list: [
{
id: "main",
groupChat: {
mentionPatterns: ["\\bbot\\b"],
},
},
],
},
}
That gives you:
hello!→ does not triggerhello bot!→ does trigger
A couple notes:
mentionPatternsare case-insensitive regexes
- skipped group messages are stored for context only, not sent to the AI as a trigger
- this is the built-in path for group chats
For 1:1 WhatsApp DMs, I do not see a built-in generic keyword-only gateway filter in the current config/docs.
Docs:
- https://docs.openclaw.ai/channels/groups
- https://docs.openclaw.ai/channels/whatsapp
- https://docs.openclaw.ai/gateway/configuration-reference#group-chat-mention-gating
If you want, paste your openclaw --version and whether this is a group or DM, and I’ll give you the exact config block.
OpenClaw 2026.4.15 (041266a), yes, I would like this to happen in 1:1 conversation, as I am sharing my phone with my openclaw, and the bot is reacting to every message I get from my allowlist contacts.
Thanks, that helps. On 2026.4.15, I do not see a built-in 1:1 WhatsApp DM keyword gate in config.
So, for normal DMs:
hello!vshello bot!style filtering is not currently a gateway config featurementionPatterns/requireMentionare for groupsselfChatModehelps with personal-number setups, but it is not a generic DM keyword filter
If your goal is “don’t let OpenClaw reply to my normal contacts on my shared phone”, the supported options are:
- Only allow yourself in WhatsApp DMs
- Use a dedicated WhatsApp number for OpenClaw, which the docs explicitly recommend
Practical config for personal-number mode:
{
session: {
dmScope: "per-channel-peer",
},
channels: {
whatsapp: {
dmPolicy: "allowlist",
allowFrom: ["+YOUR_NUMBER_ONLY"],
selfChatMode: true,
},
},
}
Notes:
allowFromwith multiple contacts means those contacts can all trigger the botsession.dmScope: "per-channel-peer"is strongly recommended if multiple people can DM it, so their conversations do not share one session, but it does not solve keyword gating
So the honest answer is: for 1:1 DMs, “only trigger if message contains keyword X” is not built in today. If you need that exact behavior, it’s a feature request: https://github.com/openclaw/openclaw/issues
Docs:
- https://docs.openclaw.ai/channels/whatsapp
- https://docs.openclaw.ai/gateway/configuration-examples#secure-dm-mode-shared-inbox--multi-user-dms
- https://docs.openclaw.ai/gateway/configuration-reference#group-chat-mention-gating
If you want, I can help you turn your current setup into the safest personal-number/self-chat config.