#Adding second agent into Discord
1 messages · Page 1 of 1 (latest)
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:
- add a second Discord account (
accountId) - bind that account to a second agent
- 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
accountIdonly matches the default Discord bot - If both bots are in the same channel, keep
requireMention: trueso 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:
- https://docs.openclaw.ai/concepts/multi-agent
- https://docs.openclaw.ai/channels/discord
- https://docs.openclaw.ai/cli/channels
- https://docs.openclaw.ai/cli/agents
If you want, paste your current channels.discord, agents.list, and bindings blocks with tokens removed, and I’ll sanity-check the exact config.
the agent already exists and it's name is Krill, rewrite the commands for me
Yep, if the agent already exists, you just need to:
- add the second Discord account
- 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 Krillmust match the actual agent id fromopenclaw agents listkrillindiscord:krillis 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.
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.```
Yep, this looks correct so far.
What your output says:
- the Discord account
krillexists - the agent
krillexists - 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.
looks like it's working
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.
i have turned on required mention but i want krill to respond without mention in a specific channel category
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 },
},
},
},
},
},
},
},
}