#whatsapp group redo

1 messages · Page 1 of 1 (latest)

barren kiln
#

I want to configure whatsapp in the following way (the bot is using my personal number):

I want it to reply in groups, but only to 2 phone numbers, and only if the message is prefixed with "aibo".
This is what I tried so far:
"whatsapp": {
"enabled": true,
"selfChatMode": true,
"allowFrom": [
"+MYNUMBER"
],
"dmPolicy": "allowlist",
"groupPolicy": "allowlist",
"groupAllowFrom": [
"+MYNUMBER",
"+OTHERNUMBER"
],
"messagePrefix": "aibo",
"groups": {
"*": {
"requireMention": false
}
}
}

so far it is not responding at all in groups, it does respond if I text "myself" in whatsapp (with or without prefix)

simple warrenBOT
fervent streamBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

simple warrenBOT
pure galleonBOT
#

First, can you paste openclaw --version?

I think I see the main issue though:

  1. If that snippet is literal, it’s in the wrong place
    It should be under channels.whatsapp, not top-level whatsapp.

  2. messagePrefix is not a gate
    For WhatsApp, channels.whatsapp.messagePrefix gets prepended to inbound text before the model sees it. It does not mean “only reply if the user typed aibo”.

  3. For true aibo ... group triggering, use mention gating
    Since you want group replies only when the message starts with aibo, set:

    • groups."*".requireMention: true
    • mentionPatterns: ["^aibo\\b"]

For a personal-number setup, I’d try this:

#
{
  channels: {
    whatsapp: {
      enabled: true,
      selfChatMode: true,
      dmPolicy: "allowlist",
      allowFrom: ["+MYNUMBER"],

      groupPolicy: "allowlist",
      groupAllowFrom: ["+MYNUMBER", "+OTHERNUMBER"],

      groups: {
        "*": { requireMention: true },
      },
    },
#
  },

  messages: {
    groupChat: {
      mentionPatterns: ["^aibo\\b"],
    },
  },
}

Why this matches your goal:

  • only these 2 senders can trigger in groups: groupAllowFrom
  • all groups are eligible: groups: { "*": ... }
  • group replies only happen when message starts with aibo: mentionPatterns
  • selfChatMode: true is fine for personal-number WhatsApp
#

Also important: in groups, sender allowlist is checked before mention/reply activation, so replying to the bot does not bypass groupAllowFrom.

Docs:

If your real config is already under channels.whatsapp and it still won’t reply, paste:

  • openclaw status --all
  • openclaw health --verbose
  • a short openclaw logs --follow snippet from one failed group message

Glad that helped! 🎉
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution.
This helps Answer Overflow index the solution for future users.

barren kiln
#

openclaw --version
OpenClaw 2026.4.21 (f788c88)

pure galleonBOT
#

Nice, thanks, 2026.4.21 is recent enough, so this should work on your version.

I’m pretty sure the fix is:

  • put it under channels.whatsapp
  • remove messagePrefix for this use case
  • set groups."*".requireMention to true
  • use mentionPatterns to make aibo the trigger

Try this exact shape:

{
  channels: {
    whatsapp: {
      enabled: true,
#
      selfChatMode: true,

      dmPolicy: "allowlist",
      allowFrom: ["+MYNUMBER"],

      groupPolicy: "allowlist",
      groupAllowFrom: ["+MYNUMBER", "+OTHERNUMBER"],

      groups: {
        "*": { requireMention: true },
      },
    },
  },

  messages: {
#
    groupChat: {
      mentionPatterns: ["^aibo\\b"],
    },
  },
}

A couple important details:

  • messagePrefix does not mean “only reply if message starts with aibo”.
    It only prefixes inbound text before the model sees it.
  • requireMention: false is the opposite of what you want here.
  • In selfChatMode, native WhatsApp mentions are ignored, so text mentionPatterns is the right way to do prefix gating.

So with the config above, group replies should happen only when:

  1. sender is +MYNUMBER or +OTHERNUMBER
#
  1. message starts with aibo

If it still doesn’t work, the next 2 things I’d want are:

openclaw status --all
openclaw logs --follow

Then send one test message in the group like:

aibo hello

from one of the two allowed numbers, and paste the relevant log lines here.

#

If you want, paste your full surrounding config block with channels: { ... }, and I’ll sanity-check the structure.

barren kiln
#

does "messages" go outside the "channels" config?

pure galleonBOT
#

Yes, exactly, messages goes outside channels.

They’re siblings at the top level:

{
  channels: {
    whatsapp: {
      enabled: true,
      selfChatMode: true,
      dmPolicy: "allowlist",
      allowFrom: ["+MYNUMBER"],
      groupPolicy: "allowlist",
      groupAllowFrom: ["+MYNUMBER", "+OTHERNUMBER"],
      groups: {
        "*": { requireMention: true },
#
      },
    },
  },

  messages: {
    groupChat: {
      mentionPatterns: ["^aibo\\b"],
    },
  },
}

So:

  • channels.whatsapp... controls who is allowed
  • messages.groupChat.mentionPatterns controls what counts as the trigger
barren kiln
#

"channels": {
"discord": {
"token": "REDACT",
"groupPolicy": "open",
"enabled": true
},
"whatsapp": {
"enabled": true,
"selfChatMode": true,
"allowFrom": [
"+REDACT"
],
"dmPolicy": "allowlist",
"groupPolicy": "allowlist",
"groupAllowFrom": [
"+REDACT",
"+REDACT"
],
"groups": {
"*": {
"requireMention": true
}
}
}
},
"messages": {
"groupChat": {
"mentionPatterns": ["^aibo\b"]
}
}

pure galleonBOT
#

Yep, that config shape looks correct now 👍

So if it’s still not replying, I don’t think the top-level structure is the problem anymore.

The next things I’d check are:

  1. Test with an exact prefix match
    Send this from one of the allowed numbers:

    aibo ping
    

    Since your pattern is ^aibo\\b, it only matches when the message starts with aibo.

  2. groupAllowFrom is sender-based
    Those numbers must be the actual phone numbers of the people sending in the group, in E.164 format.

#
  1. If you have multiple agents / custom routing
    Put the pattern on the actual agent too:

    {
      agents: {
        list: [
          {
            id: "main",
            groupChat: {
              mentionPatterns: ["^aibo\\b"],
            },
          },
        ],
      },
    }
    
#
  1. Get one failing log sample
    Please run:

    openclaw status --all
    openclaw logs --follow
    

    Then send one aibo ping in the WhatsApp group from an allowed number and paste the relevant log lines here.

One WhatsApp-specific gotcha: in selfChatMode, native mentions are ignored, so testing with just a WhatsApp @mention won’t help here. The text pattern is the important part.

If you want, paste the full config including any agents block, and I’ll check that too.

barren kiln
#

It's not responding to "aibo ping", neither in a group or in the "myself" chat

pure galleonBOT
#

That’s a really helpful clue.

If aibo ping also fails in self-chat, then this is probably not just the group gating config anymore, because:

  • messages.groupChat.mentionPatterns only affects groups
  • it should not break your WhatsApp self-chat DMs

So at this point I’d treat it as a runtime/debug issue, not a config-shape issue.

Please try this exact sequence:

openclaw gateway restart
openclaw status --all
openclaw health --verbose
openclaw logs --follow
#

Then test in this order:

  1. self-chat: ping
  2. self-chat: aibo ping
  3. group chat from allowed number: aibo ping

Then paste the relevant log lines here.

What I’m trying to separate:

  • if self-chat ping works but group aibo ping doesn’t, we’re down to group gating / sender matching
  • if self-chat also fails, something broader is wrong, like:
    • WhatsApp listener state
    • config reload/restart state
    • gateway not applying the updated config

For now, I would keep this config:

#
{
  channels: {
    whatsapp: {
      enabled: true,
      selfChatMode: true,
      dmPolicy: "allowlist",
      allowFrom: ["+MYNUMBER"],
      groupPolicy: "allowlist",
      groupAllowFrom: ["+MYNUMBER", "+OTHERNUMBER"],
      groups: {
        "*": { requireMention: true },
      },
    },
  },
  messages: {
#
    groupChat: {
      mentionPatterns: ["^aibo\\b"],
    },
  },
}

and do not add messagePrefix back.

If you paste the status --all + log output, we can probably pin this down pretty fast.

barren kiln
#

It's not responding, but just noticed the channel's interface says: {"error":{"data":{"reason":"401","location":"frc"},"isBoom":true,"isServer":false,"output":{"statusCode":401,"payload":{"statusCode":401,"error":"Unauthorized","message":"Connection Failure"},"headers":{}}},"date":"2026-04-23T14:25:32.687Z"}

pure galleonBOT
#

Ah, yep, that 401 is the real problem.

401 Unauthorized / Connection Failure on the WhatsApp channel usually means the linked WhatsApp Web session got logged out / lost auth. If the session isn’t connected, none of the allowlist or aibo config matters yet.

What I’d do next:

openclaw status --all
openclaw channels login --channel whatsapp
openclaw gateway restart

Then scan the new QR in WhatsApp → Linked Devices.

If you were using a named WhatsApp account, use:

#
openclaw channels login --channel whatsapp --account <account-id>

After that, re-test in this order:

  1. self-chat: ping
  2. self-chat: aibo ping
  3. group from allowed number: aibo ping

So the current picture is:

  • your config shape now looks basically right
  • but the WhatsApp channel itself is unauthorized/logged out
  • fix the login first, then re-check the aibo behavior

Docs:

barren kiln
#

I used the "re-link" button on the interface and is now responding! it works OK in groups (it responds with the prefix and doens't without it. But in self-chat it responds even without prefix.

pure galleonBOT
#

Nice, glad we found it, the 401 was the blocker 🎉

And yes, the self-chat behavior is expected.

Why:

  • your mentionPatterns live under messages.groupChat
  • that only affects group chats
  • self-chat is still a DM, so it follows dmPolicy / allowFrom, not the aibo prefix rule

So right now your setup means:

  • groups: only allowed numbers, and only when message starts with aibo
  • self-chat: allowed regardless of prefix

If you want self-chat to also require aibo, I don’t think there’s a built-in hard config gate for that right now.