#discord 2bots in the same server and different channel chat no works

34 messages · Page 1 of 1 (latest)

worthy salmon
#

I set 2 bots , 2bot with 2 agent.
I chat 2 bots is works. But I chat in server or in channel isn't work.
my config.json like that
"discord": {
"enabled": true,
"defaultAccount": "Discord-main",
"groupPolicy": "allowlist",
"accounts": {
"Discord-main": {
"token": "BOT1-TOKEN",
"guilds": {
"server-id": {
"requireMention": true,
"users": [
"userid"
],
"channels": {
"channel1-id": {
"enabled": true
},
"channel2-id": {
"enabled": true
}
}
}
}
},
"PPClaw-client": {
"token": "BOT2-TOKEN",
"guilds": {
"server-id": {
"requireMention": true,
"users": [
"userid"
],
"channels": {
"channel1-id": {
"enabled": true
},
"channel3-id": {
"enabled": true
}
}
}
}
}

crude wingBOT
#

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

subtle phoenixBOT
worthy salmon
#

discord 2bots in the same server and different channel chat no works

soft narwhalBOT
#

Your config shape is mostly right. The common reasons DM works but server channels do not are:

  1. requireMention: true
    In guild channels, the bot only replies when you @mention that bot.
    If you want normal channel chat, set requireMention: false.

  2. groupPolicy: "allowlist"
    Only the listed guild ID and channel IDs are allowed. If one ID is wrong, that channel is blocked.

  3. Discord intents not enabled
    In the Discord Developer Portal, for both bot apps, enable:

    • Message Content Intent (required)
    • Server Members Intent (recommended)

    Then restart OpenClaw.

  4. Bindings must match accountId

#

With 2 bots and 2 agents, make sure routing is explicit, for example:

bindings: [
  { agentId: "agent1", match: { channel: "discord", accountId: "Discord-main" } },
  { agentId: "agent2", match: { channel: "discord", accountId: "PPClaw-client" } }
]

If you want channel messages without mentioning the bot, use:

"guilds": {
  "server-id": {
    "requireMention": false,
    "channels": {
#
      "channel1-id": { "enabled": true }
    }
  }
}

Please paste these 3 outputs next, that will usually show the exact blocker:

openclaw --version
openclaw channels status --probe
openclaw logs --follow

Docs:

#

Yes, this setup should work, 2 Discord bots, same server, different channels is supported.

Your most likely blocker is one of these:

  • requireMention: true
    In channels, the bot replies only if you @mention that bot.
  • users: [...]
    Only that user can trigger the bot. If the ID is wrong, it looks dead.
  • Missing Message Content Intent on one or both Discord bot apps.
  • Missing bindings for each Discord accountId.

For debugging, I’d simplify first:

bindings: [
  { agentId: "agent1", match: { channel: "discord", accountId: "Discord-main" } },
#
  { agentId: "agent2", match: { channel: "discord", accountId: "PPClaw-client" } }
],

channels: {
  discord: {
    defaultAccount: "Discord-main",
    groupPolicy: "allowlist",
    accounts: {
      "Discord-main": {
        token: "BOT1-TOKEN",
        guilds: {
          "SERVER_ID": {
            requireMention: false,
            channels: {
              "CHANNEL1_ID": { enabled: true },
#
              "CHANNEL2_ID": { enabled: true }
            }
          }
        }
      },
      "PPClaw-client": {
        token: "BOT2-TOKEN",
        guilds: {
          "SERVER_ID": {
            requireMention: false,
            channels: {
              "CHANNEL1_ID": { enabled: true },
              "CHANNEL3_ID": { enabled: true }
            }
          }
#
        }
      }
    }
  }
}

Important test steps

  1. Temporarily remove users while testing.
  2. Set requireMention: false while testing.
  3. In Discord Developer Portal, enable for both bots:
    • Message Content Intent
    • Server Members Intent (recommended)
  4. Restart OpenClaw.

If it starts working after that, then the issue was mention-gating or allowlist.

worthy salmon
#

Is it something wrong with my bingding config?{
"type": "route",
"agentId": "discord-main-agent",
"match": {
"channel": "discord",
"accountId": "Discord-main"
}
}

soft narwhalBOT
#

I don’t think that binding is the main problem.

Your binding is valid:

{
  type: "route",
  agentId: "discord-main-agent",
  match: {
    channel: "discord",
    accountId: "Discord-main"
  }
}

A few important things:

#
  • type: "route" is fine, it is the normal binding type.
  • accountId: "Discord-main" is correct if your Discord account key is exactly "Discord-main".
  • You also need a second binding for the second bot account.

Example:

bindings: [
  {
    agentId: "discord-main-agent",
    match: { channel: "discord", accountId: "Discord-main" }
  },
  {
    agentId: "ppclaw-agent",
    match: { channel: "discord", accountId: "PPClaw-client" }
  }
#
]

The key point

Bindings only choose which agent gets the message.
They do not control whether Discord guild/channel messages are allowed.

Guild/channel replies are controlled by:

  • groupPolicy
  • guilds
  • channels
  • users
  • requireMention
  • Discord intents
#

So if DM works but server/channel does not, that usually means:

  1. requireMention: true is blocking it, you must @mention the bot
  2. users: [...] is blocking it
  3. one of the channel IDs/server IDs is wrong
  4. Message Content Intent is not enabled for one or both bots

Best debug test

Temporarily do this for both accounts:

  • remove users
  • set requireMention: false
  • keep only one test channel
  • restart OpenClaw

If that works, then the problem is definitely mention-gating or allowlist.

#

Also check

In Discord Developer Portal, for both bots:

  • enable Message Content Intent
  • enable Server Members Intent (recommended)

So, short answer

  • No, that binding is not obviously wrong
  • Yes, you need one binding per bot account
  • The more likely problem is guild/channel access config, not bindings

If you paste your full bindings: [...] array plus redacted channels.discord block, I can tell you the exact bad line. Docs: https://docs.openclaw.ai/channels/discord and https://docs.openclaw.ai/concepts/multi-agent

worthy salmon
#

When I use one bot, it works. My bot1 can return message in my server main channel.

soft narwhalBOT
#

Ah, that helps.

If bot1 works in the server channel, then your general Discord guild config is probably fine.
That means the problem is most likely specific to bot2.

Most likely causes, in order:

  1. bot2 is missing its own binding
    You showed only:
{
  type: "route",
  agentId: "discord-main-agent",
  match: {
    channel: "discord",
#
    accountId: "Discord-main"
  }
}

You also need one for bot2:

{
  type: "route",
  agentId: "ppclaw-agent",
  match: {
    channel: "discord",
    accountId: "PPClaw-client"
  }
#
}
  1. bot2 Discord app does not have Message Content Intent enabled
    This is a very common one. DM can work, but guild/channel replies fail.

    In Discord Developer Portal, for BOT2 app:

    • enable Message Content Intent
    • enable Server Members Intent too
    • save
    • restart OpenClaw
  2. bot2 is not actually allowed in that channel
    Check bot2 has permission for:

    • View Channel
    • Send Messages
#
  • Read Message History
  1. requireMention: true
    In channel testing, make sure you are @mentioning bot2, not just typing normally.

My guess

I’m pretty sure it is either missing bot2 binding or bot2 missing Message Content Intent.

Minimal check

Make sure your bindings look like this:

bindings: [
  {
    type: "route",
    agentId: "discord-main-agent",
worthy salmon
#

My bindings config is same as your show. I want to chat all my bot(need mentioning) in one server(server-id) main channel(channel-id1) . And bot1 can chat in channel1-5(chainnelid1-5),bot2 only can chat in channel1 and 2. So how to change the config?

soft narwhalBOT
#

Yep, that is exactly what per-account guilds.channels is for.

Use the same server ID for both bots, then give each bot its own allowed channel list.

{
  bindings: [
    {
      type: "route",
      agentId: "discord-main-agent",
      match: { channel: "discord", accountId: "Discord-main" }
    },
    {
      type: "route",
      agentId: "discord-bot2-agent",
      match: { channel: "discord", accountId: "PPClaw-client" }
#
    }
  ],

  channels: {
    discord: {
      enabled: true,
      defaultAccount: "Discord-main",
      groupPolicy: "allowlist",
      accounts: {
        "Discord-main": {
          token: "BOT1-TOKEN",
          guilds: {
            "SERVER_ID": {
              requireMention: true,
              users: ["YOUR_USER_ID"], // optional, remove if anyone may trigger
#
              channels: {
                "CHANNEL1_ID": { enabled: true },
                "CHANNEL2_ID": { enabled: true },
                "CHANNEL3_ID": { enabled: true },
                "CHANNEL4_ID": { enabled: true },
                "CHANNEL5_ID": { enabled: true }
              }
            }
          }
        },

        "PPClaw-client": {
          token: "BOT2-TOKEN",
          guilds: {
            "SERVER_ID": {
#
              requireMention: true,
              users: ["YOUR_USER_ID"], // optional
              channels: {
                "CHANNEL1_ID": { enabled: true },
                "CHANNEL2_ID": { enabled: true }
              }
            }
          }
        }
      }
    }
  }
}

Result

#
  • channel1: both bot1 and bot2 can reply
  • channel2: both bot1 and bot2 can reply
  • channel3-5: only bot1 can reply
  • because requireMention: true, you must mention the bot you want

Notes

  • users: ["YOUR_USER_ID"] means only you can trigger the bots.
    If you want anyone in the server to trigger them, remove users.
  • Use real numeric Discord IDs as strings.
  • Both bots must be invited to the server and have access to those channels.
  • Both bot apps should have Message Content Intent enabled.

Docs: https://docs.openclaw.ai/channels/discord

If you want, paste your redacted full config and I’ll sanity-check it line by line.

worthy salmon
#

Well, I managed to succeed after testing it a few more times; it appears to have been a network issue.

soft narwhalBOT
#

Nice, glad you caught it 🎉

That makes sense, flaky network can look exactly like bad multi-bot config.

If it happens again, the fastest checks are:

openclaw channels status --probe
openclaw logs --follow

If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution.
That helps Answer Overflow index it for the next person.