#Agent to Agent Discord Bots Chatting in the same Channel

1 messages · Page 1 of 1 (latest)

rapid mirage
#

I have set discord.allowBots=true and requireMention=false but I'm still getting 09:39:10 info discord-auto-reply {"module":"discord-auto-reply"} {"channelId":"-REDACTED-","reason":"no-mention"} discord: skipping guild message

oak tigerBOT
#

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

paper latchBOT
#

That log means mention-gating is still on for that guild/channel. On Discord, requireMention is not a top-level discord.* switch — it lives under your guild config (and can be overridden again per-channel).

From the config reference, the relevant shape is:

  • channels.discord.allowBots
  • channels.discord.guilds."<GUILD_ID>".requireMention
  • optionally channels.discord.guilds."<GUILD_ID>".channels.<channelKey>.requireMention

Docs:

Fix (example)

{
#
  channels: {
    discord: {
      allowBots: true,

      // make sure the guild/channel is actually allowed (groupPolicy defaults to allowlist)
      groupPolicy: "allowlist",
      guilds: {
        "YOUR_GUILD_ID": {
          requireMention: false, // <- this is the important one

          channels: {
            // channel keys are the *slugged channel name* (no "#")
            "agent-to-agent-discord-bots-chatting-in-the-same-channel": {
              allow: true,
#
              // if you previously set this to true, it will override the guild default:
              requireMention: false,
            },
          },
        },
      },
    },
  },
}

3 things that commonly cause “I set it but it still says no-mention”

  1. Set in the wrong place (e.g. discord.requireMention=false or channels.discord.groups... — Discord uses guilds, not groups).
  2. Per-channel override still requires mention (channels.discord.guilds.<id>.channels.<key>.requireMention: true).
  3. Gateway wasn’t restarted after config change (Discord config is read at startup).
#

If you paste these, I can tell you exactly what’s happening

  • openclaw --version
  • your channels.discord block (redact token)
  • the gateway startup log lines that mention config validation (warnings like “Unrecognized key 
” are the smoking gun when settings are being ignored)
rapid mirage
#

So wait, I have to explicitly define requireMention=false in discord.accounts.<id>.guilds.channels.<channelId>?

paper latchBOT
#

No — you don’t have to set it all the way down at the channel level unless you’re overriding it per-channel.

There are two separate questions here:

1) Single Discord bot (no channels.discord.accounts block)

Set it on the guild, once:

{
  channels: {
    discord: {
      allowBots: true,
      groupPolicy: "allowlist",
      guilds: {
        "YOUR_GUILD_ID": {
          requireMention: false,
#
          channels: {
            "YOUR_CHANNEL_ID": { allow: true }, // or slugged name in some examples
          },
        },
      },
    },
  },
}

That should stop reason:"no-mention" for that guild (unless you explicitly set requireMention:true on that specific channel).

Also note from the docs: Discord mention-gating defaults can live under channels.discord.guilds["*"], so if you have that set to true, make sure you override it on your specific guild ID. Docs: https://docs.openclaw.ai/channels/groups

2) Multi-account Discord (you do have channels.discord.accounts)

Then yes: you must set requireMention under the account you’re actually using, because each bot account has its own guilds config:

#
{
  channels: {
    discord: {
      allowBots: true,
      groupPolicy: "allowlist",
      accounts: {
        default: {
          token: "
",
          guilds: {
            "YOUR_GUILD_ID": {
              requireMention: false,
              channels: {
                "YOUR_CHANNEL_ID": { allow: true },
              },
            },
#
          },
        },
      },
    },
  },
}

You still don’t need requireMention:false under each channel unless you want per-channel differences.

If it’s still logging no-mention

Paste (redacting tokens) your channels.discord config block + openclaw --version. The most common cause is “I set requireMention=false but in the wrong place / wrong accountId / wildcard guilds["*"] still forces it”, and the config shape makes that immediately obvious.

rapid mirage
#

Maybe because I have discord.accounts.<id>.guillds.<guildId>.users[] defined?

paper latchBOT
#

Unlikely. guilds.<guildId>.users[] doesn’t enable mention-gating — it’s a sender allowlist (and also used for things like reaction notification allowlist mode per the config ref).

The key point is: your log says reason:"no-mention", which specifically means OpenClaw still believes requireMention is in effect for that message (either via config inheritance, a per-channel override, or /activation state), not that the sender failed a users[] allowlist check.

That said, if you do set users[] and you’re trying to have bot ↔ bot chatting, you’ll need to include the other bot’s Discord user ID in that list (bots are still “users” for allowlisting). Otherwise you may hit a different “skipping” reason once mention-gating is actually off.

Concrete checks (these usually reveal the culprit fast):

  1. Make sure you’re setting it in the right account scope (if you use channels.discord.accounts):
openclaw config get channels.discord.accounts.<accountId>.guilds."<guildId>".requireMention
openclaw config get channels.discord.accounts.<accountId>.guilds."<guildId>".channels
  1. Check whether you have a wildcard default forcing mentions:
#
openclaw config get channels.discord.guilds."*"
# or if accounts:
openclaw config get channels.discord.accounts.<accountId>.guilds."*"
  1. If you ever ran /activation mention in that thread/channel, flip it back with:
  • /activation always (standalone message)

If you paste your channels.discord block (redact tokens) + openclaw --version, I can point at the exact field that’s still turning mention-gating on.

rapid mirage
#
    "discord": {
      "enabled": true,
      "allowBots": true,
      "groupPolicy": "open",
      "accounts": {
        "main": {
          "token": "-redacted-",
          "guilds": {
            "-redacted-": {
              "requireMention": false,
              "users": [
                "-redacted-"
              ],
              "channels": {
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true, "requireMention": true},
                "-redacted-": { "allow": true, "requireMention": true }
              }
            }
          }
        },
        "research": {
          "token": "-redacted-",
          "guilds": {
            "-redacted-": {
              "requireMention": false,
              "users": [
                "-redacted-"
              ],
              "channels": {
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true },
                "-redacted-": { "allow": true, "requireMention": true},
                "-redacted-": { "allow": true, "requireMention": true }
              }
            }
          }
        },
paper latchBOT
#

No — users: [...] isn’t what’s causing reason:"no-mention".

In the config you pasted, you explicitly turn mention-gating back on for (at least) two channels:

"channels": {
  "...": { "allow": true, "requireMention": true },
  "...": { "allow": true, "requireMention": true }
}

Per the config model, the effective value is basically:

channel.requireMention (if set) → else guild.requireMention → else default (true)

So even though you have:

#
guilds: { "<guildId>": { requireMention: false } }

those per-channel requireMention: true overrides will still produce no-mention in those channels (and you’ll see exactly the log you’re seeing).

What users: [...] actually does

guilds.<guildId>.users is a sender allowlist for that guild config (i.e., who is allowed to trigger the bot there / for allowlist-style modes). It doesn’t enable mention-gating, but it can block bot-to-bot chatting if the other bot’s user id isn’t in that list.

So the likely sequence for your setup is:

  1. Fix/remove the per-channel requireMention: true overrides (or set them to false), restart gateway.
  2. If you’re doing bot ↔ bot triggers, make sure the other bot’s Discord user ID is permitted by your users restrictions (or remove users to test).

Quick sanity check

Take the channelId from the log (don’t redact it—channel IDs aren’t secrets) and match it against which channel entry has requireMention:true. That’ll confirm it immediately.

Docs reference: https://docs.openclaw.ai/gateway/configuration-reference (Discord section + group mention gating behavior)

rapid mirage
#

So if you were to fix that discord block how would you do it?

paper latchBOT
#

You’ve basically got it already — the only thing “broken” in that block is that you override the guild default in a couple channels:

  • guild: requireMention: false
  • but channel: requireMention: true ⟶ wins, so you get reason:"no-mention" in those channels.

So the fix is: remove those per-channel overrides (or flip them to false) for the channel(s) where you want bot-to-bot chatter without pings.

What I’d change (minimal diff)

For each account (main and research), in that guild:

discord: {
  enabled: true,
  allowBots: true,
  groupPolicy: "open", // ok
#
  accounts: {
    main: {
      token: "...",
      guilds: {
        "<guildId>": {
          requireMention: false,
          users: ["<allowedUserOrBotId>"],

          channels: {
            "<channelA>": { allow: true },                    // inherits requireMention:false
            "<channelB>": { allow: true, requireMention: false }, // explicitly off (optional)
            // DELETE / CHANGE these:
            // "<channelX>": { allow: true, requireMention: true },
            // "<channelY>": { allow: true, requireMention: true },
          },
#
        },
      },
    },

    research: {
      token: "...",
      guilds: {
        "<guildId>": {
          requireMention: false,
          users: ["<allowedUserOrBotId>"],
          channels: {
            "<channelA>": { allow: true },
            "<channelB>": { allow: true, requireMention: false },
          },
        },
#
      },
    },
  },
}

If you do want mention-gating in a couple channels, keep requireMention:true only in those — just make sure the channel that’s logging no-mention isn’t one of them.

Important: users: [...] for bot-to-bot

This doesn’t cause no-mention, but it can block triggering later. If you want other bots to trigger replies, include the other bot’s Discord user id in that users list (bots are still “users” for allowlisting). Easiest test: temporarily remove users entirely, confirm it works, then re-add a tighter list.

Don’t forget

After editing config: openclaw gateway restart (Discord reads config at startup).

If you paste the non-redacted channelId from the log line (the one that’s skipping), I can tell you exactly which channels.<id> entry is overriding you.

rapid mirage
#

Ok cool. It finally works now. Just one question.. How to make them stop without restarting 😅

paper latchBOT
#

You can’t hot-reload the config file (most channel config changes need a gateway restart), but you can stop replies in that channel at runtime:

Option A (recommended): switch the channel back to “mention-only”

In that Discord channel, send:

  • /activation mention

That will make it ignore normal messages again (so the bots won’t keep triggering each other), until you flip it back with:

  • /activation always

(/activation is “groups only”, which includes Discord guild channels.) Docs: https://docs.openclaw.ai/tools/slash-commands

Option B: hard-silence that session (if you’re authorized)

In that channel:

  • /send off
#

And later:

  • /send on (or /send inherit)

If you tell me whether you want “only reply on @mention” vs “don’t reply at all”, I’ll tell you which one fits better for bot-to-bot channels.

rapid mirage
#

They've been going on for 2 hours now. I tried /activation mention but 3 of them (out of five) still talk. Also tried /send off but uhh nothing happened. Restarted the gateway and they stopped. Although I'm finding a way on how to make them shut it with one word. haha

paper latchBOT
#

Two gotchas here:

  1. /activation mention won’t necessarily stop a bot-loop on Discord, because replying to a bot message counts as an implicit mention on Discord. So if the bots are replying-to each other, they can keep triggering even in “mention-only” mode.

  2. /send off is per-bot + per-session, and it’s authorization-gated. If a bot doesn’t ACK it (you should normally see some kind of “ok/ack”), it likely treated it as plain text because you’re not authorized for that bot (common when you have multiple bot accounts / other people’s bots).

What to do when they’re mid-spam without restarting:

Immediate “panic” stop (one word)

Send a standalone message:

  • stop

That’s treated like /stop (abort phrase) and will cancel the currently-running generation in that channel/thread session. If the loop is driven by in-flight generations, this usually breaks the chain.

If some bots ignore stop / /send off

Those bots aren’t accepting your directives. That can happen if:

#
  • they’re not your bots (other people’s gateways), or
  • your Discord user id isn’t allowlisted for commands on those bot accounts (e.g. guilds.<id>.users / command allowlists differ per bot), or
  • you’re issuing it in a thread, but the bots are talking in the parent channel (different session key).

“Make this never happen again” (config-level)

When you want “mention-only” to actually halt loops, also make bots not reply using Discord reply metadata:

  • set channels.discord.replyToMode: "off" (or equivalent per-account if you’re using accounts)

Then, with /activation mention, bot messages won’t be treated as implicit mentions anymore.

If you tell me: are those 5 bots all your OpenClaw bots/accounts, or are some other people’s bots in that channel too? That determines whether a single command can ever stop all of them.

rapid mirage
#

Yeah, they're all mine

paper latchBOT
#

If they’re all yours, the reason “mention mode” didn’t fully stop the loop is: on Discord replying to a bot message counts as an implicit mention, so once they get into reply-chains they can keep re-triggering even after /activation mention.

Also: /send off doesn’t cancel an in-flight run; it only stops future sends for that session. Pair it with stop.

Right-now (no restart) “make it shut up”

In the channel where they’re spamming, send a standalone:

  • stop

Do it once or twice if multiple bots are concurrently mid-generation. This aborts the active run in that channel session.

“One command” kill switch (no restart, but requires one-time setup)

Enable runtime overrides once (config + restart one time):

{ commands: { debug: true } }
#

Then next time they loop, you can instantly stop bot-to-bot triggering with a single command:

  • /debug set channels.discord.allowBots=false

That makes the gateway ignore bot-authored messages (so the loop can’t continue). When you’re done experimenting:

  • /debug reset (or /debug unset channels.discord.allowBots)

Docs: https://docs.openclaw.ai/help/debugging

Prevent the loop in the first place (recommended)

Set the bots to not reply as replies in that channel/guild, so “implicit mention via reply” can’t happen:

  • set replyToMode: "off" (per Discord account, if you’re using accounts)

From the config reference: https://docs.openclaw.ai/gateway/configuration-reference (Discord replyToMode)

#

If you want, paste (non-redacted) the channelId that was looping + how many Discord accounts you have, and I’ll give you the exact smallest config snippet (per-account vs global) to make “/activation mention” actually behave like a hard stop.

rapid mirage
#

Hmm but how can I enable like role mentions in the config?

paper latchBOT
#

If you mean “let role pings count as a mention trigger” (so the bot replies when someone types @MyRole), that’s not a special Discord toggle in channels.discord
. In OpenClaw you do it via mentionPatterns (regex), because Discord role mentions aren’t the same thing as mentioning the bot user.

Make role mentions trigger the bot

  1. Turn mention-gating on for that guild/channel (otherwise it replies to everything and the role mention doesn’t matter):
channels: {
  discord: {
    accounts: {
      main: {
        guilds: {
          "YOUR_GUILD_ID": {
            requireMention: true,
            channels: {
              "YOUR_CHANNEL_ID": { allow: true, requireMention: true },
            },
#
          },
        },
      },
    },
  },
},
  1. Add the role mention markup to the agent’s mentionPatterns:
agents: {
  list: [
    {
      id: "main",
#
      groupChat: {
        // Discord role mentions come through as: <@&ROLE_ID>
        mentionPatterns: ["<@&123456789012345678>"],
      },
    },
    {
      id: "research",
      groupChat: {
        mentionPatterns: ["<@&123456789012345678>"],
      },
    },
  ],
},

Then restart the gateway (config change).

#

Docs for mentionPatterns / mention gating: https://docs.openclaw.ai/channels/groups

If you meant “allow the bot to ping roles in its own outgoing messages”

That’s mostly Discord-side permissions, not OpenClaw config:

  • the role must be Mentionable (or the bot must have permission to mention it),
  • and the bot needs the appropriate guild/channel permissions.

If you tell me which of the two you meant (trigger-on-role vs outgoing-ping-role), I can tailor the exact snippet for your current “accounts/main+research” layout.

rapid mirage
#

Ok, one last question. Every new session (/new) what gets injected into an agents prompt

paper latchBOT
#

That reason:"no-mention" log is only emitted when Discord preflight thinks shouldRequireMention=true for that guild/channel (so it’s still running with mention-gating on).

Two common gotchas:

  • The config keys are not discord.* at top-level — they live under channels.discord.*.
  • requireMention is per guild / per channel, i.e. channels.discord.guilds.<GUILD_ID>.requireMention (or a channel entry), and defaults to true if it can’t find your override.

Docs + example: https://docs.openclaw.ai/channels/discord (see requireMention section)

{
  channels: {
    discord: {
      allowBots: true,
      guilds: {
        YOUR_SERVER_ID: {
#
          requireMention: false,
        },
      },
    },
  },
}

What gets injected into an agent prompt on every /new session?

/new (same as /reset) starts a fresh sessionId for that chat/sessionKey — i.e. it clears the conversation history and then continues with the new turn (and /new alone triggers a short “hello” confirm). It does not change what OpenClaw injects as baseline context.
Docs: https://docs.openclaw.ai/concepts/session

On every run/turn (including the first turn after /new), OpenClaw assembles a System Prompt and appends Project Context (workspace bootstrap files).

#

Docs: https://docs.openclaw.ai/concepts/system-prompt

Injected under “Project Context” (workspace files):

  • AGENTS.md
  • SOUL.md
  • TOOLS.md
  • IDENTITY.md
  • USER.md
  • HEARTBEAT.md
  • BOOTSTRAP.md (only on brand-new workspaces)
  • MEMORY.md and/or memory.md (if present)

Important nuance: memory/*.md daily files are not auto-injected; those are meant to be pulled on-demand via memory_search / memory_get.

If you want to see the exact prompt makeup in your instance, send:

  • /context list (quick overview)
  • /context detail (breakdown + token/char contribution)