#Adding second agent into Discord

1 messages · Page 1 of 1 (latest)

glacial aspen
#

Krill, guide me in adding second agent to Discord.

version: 🦞 OpenClaw 2026.4.15 (041266a)

I have already invited the bot to my discord server. I need help with settings on openclaw

spring sandBOT
dry marshBOT
#

Let me verify the exact Discord config shape so I don’t make up keys.

#

Yep, 2026.4.15 is new enough for this.

If by “second agent” you mean a second Discord bot/account routed to a different OpenClaw agent, the pattern is:

  1. add a second Discord account (accountId)
  2. bind that account to a second agent
  3. allowlist the guild/channel for that account

Easiest CLI path

# second bot token, on the machine running OpenClaw
export DISCORD_BOT_TOKEN_HELPER2="..."

# add the second Discord account
openclaw channels add --channel discord --account helper2 --token "$DISCORD_BOT_TOKEN_HELPER2"
#

# create a second agent and bind it to that Discord account
openclaw agents add helper2 --workspace ~/.openclaw/workspace-helper2 --bind discord:helper2 --non-interactive

# restart gateway
openclaw gateway restart

If the agent already exists, use:

openclaw agents bind --agent helper2 --bind discord:helper2

Config shape

#
{
  agents: {
    list: [
      { id: "main", workspace: "~/.openclaw/workspace-main" },
      { id: "helper2", workspace: "~/.openclaw/workspace-helper2" },
    ],
  },
  bindings: [
    { agentId: "main", match: { channel: "discord", accountId: "default" } },
    { agentId: "helper2", match: { channel: "discord", accountId: "helper2" } },
  ],
  channels: {
    discord: {
      enabled: true,
      groupPolicy: "allowlist",
#
      accounts: {
        default: {
          token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN" },
          guilds: {
            "YOUR_GUILD_ID": {
              channels: {
                "YOUR_CHANNEL_ID": { allow: true, requireMention: true },
              },
            },
          },
        },
        helper2: {
          token: { source: "env", provider: "default", id: "DISCORD_BOT_TOKEN_HELPER2" },
          guilds: {
            "YOUR_GUILD_ID": {
#
              channels: {
                "YOUR_CHANNEL_ID": { allow: true, requireMention: true },
              },
            },
          },
        },
      },
    },
  },
}

Important gotchas

  • Each Discord bot needs its own token
  • Invite both bots to the server
#
  • Enable Message Content Intent for both bots
  • A binding with no accountId only matches the default Discord bot
  • If both bots are in the same channel, keep requireMention: true so they don’t both answer

Nice bit: if your first bot is still using top-level channels.discord.token, openclaw channels add should promote that into channels.discord.accounts.default for you.

Docs:

If you want, paste your current channels.discord, agents.list, and bindings blocks with tokens removed, and I’ll sanity-check the exact config.

glacial aspen
#

the agent already exists and it's name is Krill, rewrite the commands for me

dry marshBOT
#

Yep, if the agent already exists, you just need to:

  1. add the second Discord account
  2. bind that Discord account to the existing agent

Assuming you want the new Discord accountId to also be krill:

export DISCORD_BOT_TOKEN_KRILL="..."

openclaw channels add --channel discord --account krill --token "$DISCORD_BOT_TOKEN_KRILL"

openclaw agents bind --agent Krill --bind discord:krill

openclaw gateway restart
#

Optional checks after:

openclaw agents list --bindings
openclaw channels status --probe

Two small gotchas:

  • --agent Krill must match the actual agent id from openclaw agents list
  • krill in discord:krill is the Discord accountId, not the agent name, it can be different, but matching them keeps life simpler

If you want, I can also rewrite the matching channels.discord.accounts.krill.guilds... config block for your server/channel IDs.

glacial aspen
#

Agents:
- main (default)
  Identity: 🦋 Moth (IDENTITY.md)
  Workspace: ~/.openclaw/workspace
  Agent dir: ~/.openclaw/agents/main/agent
  Model: openai-codex/gpt-5.4
  Routing rules: 0
  Routing: default (no explicit rules)
  Providers:
    - Discord krill: configured
- krill
  Identity: 🦐 Krill (IDENTITY.md)
  Workspace: ~/.openclaw/workspace-krill
  Agent dir: ~/.openclaw/agents/krill/agent
  Model: openai-codex/gpt-5.4
  Routing rules: 1
  Routing: Discord krill
  Providers:
    - Discord krill: configured
  Routing rules:
    - discord accountId=krill
Routing rules map channel/account/peer to an agent. Use --bindings for full rules.
Channel status reflects local config/creds. For live health: openclaw channels status --probe.```
dry marshBOT
#

Yep, this looks correct so far.

What your output says:

  • the Discord account krill exists
  • the agent krill exists
  • routing is already set: discord accountId=krill -> agent krill

So you do not need to run openclaw agents bind again.

The next piece is usually the guild/channel allowlist for that Discord account.

Add the server/channel for the krill bot

{
#
  channels: {
    discord: {
      groupPolicy: "allowlist",
      accounts: {
        krill: {
          guilds: {
            "YOUR_GUILD_ID": {
              channels: {
                "YOUR_CHANNEL_ID": { allow: true, requireMention: true },
              },
            },
          },
        },
      },
    },
#
  },
}

Then restart:

openclaw gateway restart
openclaw channels status --probe

Important note

main showing:

  • Providers: Discord krill: configured
#

does not mean Discord is routed to main. It just means that Discord account is available in config.
The actual routing line is the important part, and yours is already:

  • discord accountId=krill

If it still doesn’t reply, check these 3 things

  • the Krill bot is invited to that server
  • Message Content Intent is enabled for that bot in the Discord developer portal
  • if both bots are in the same channel, keep requireMention: true

Docs:

If you paste your redacted channels.discord block, I can point to the exact missing line.

glacial aspen
#

looks like it's working

dry marshBOT
#

Nice, glad we got it working 🎉

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

If you want, I can also help you clean up the final config a bit, like requireMention, channel allowlists, or keeping the two bots from stepping on each other.

glacial aspen
#

i have turned on required mention but i want krill to respond without mention in a specific channel category

dry marshBOT
#

Let me check whether Discord allowlists support category-level requireMention directly, or only per-channel.

#

Yep, the catch is: Discord mention gating is only configurable at the guild or channel level, not by category.

So for your krill bot/account, the pattern is:

  • keep the guild default as requireMention: true
  • set specific channels under that category to requireMention: false

Example:

{
  channels: {
    discord: {
      accounts: {
        krill: {
          guilds: {
#
            "YOUR_GUILD_ID": {
              requireMention: true,
              channels: {
                "CHANNEL_ID_1": { allow: true, requireMention: false },
                "CHANNEL_ID_2": { allow: true, requireMention: false },
                "CHANNEL_ID_3": { allow: true, requireMention: false },
              },
            },
          },
        },
      },
    },
  },
}