docs/book/src/channels/discord.md
Run your ZeroClaw agent as a Discord bot. This guide walks you through it click by click, no prior bot experience needed. By the end you'll have a bot sitting in your server that replies when people talk to it.
{{#peer-group discord}}
Five steps: make the bot, copy its token, turn on two switches, invite it, and start ZeroClaw.
bot_token. Keep it somewhere safe for step 3, you cannot see it again
later (only reset it).The bot token is a password for your bot. Anyone who has it can control your bot. Never paste it into a public chat, screenshot, or commit it to git.
Still on the Bot page, scroll to Privileged Gateway Intents and toggle both of these on:
Click Save Changes. If you skip this, the bot connects but never sees any messages, which is the single most common "my bot does nothing" cause.
Put the token from step 1 into your config. The token is a secret, so set it
through a surface that encrypts it rather than typing it into config.toml:
{{#config-where channels discord}}
{{#secret-config channels.discord.<alias>.bot_token}}
The bot now shows up in your member list (offline until you start ZeroClaw).
Start ZeroClaw (zeroclaw service restart or zeroclaw daemon), then send a
message in a channel the bot can see. It should reply. If it doesn't, jump to
Troubleshooting.
The full field list, derived from the live schema. Most have sensible
defaults; for a basic bot you only ever set bot_token.
{{#config-fields channels.discord}}
By default the bot listens in every server it's invited to and every channel it can see. To scope it down:
guild_ids: limit the bot to specific servers (guilds). Empty means all.channel_ids: limit it to specific channels. Empty means all visible.To find an ID, enable Developer Mode in Discord (User Settings -> Advanced), then right-click a server or channel and Copy ID.
{{#thread-context channel="Discord"}}
Set archive = true and the channel opens a sidecar discord.db memory store,
records every message it sees, and registers a discord_search tool the agent
can use to look up past conversation. Leave it off if you don't need history
search; the bot still replies normally either way.
{{#streaming channel="Discord" mode="stream_mode" path="channels.discord.<alias>.stream_mode"}}
mention_only: when true, the bot only answers messages that @-mention it,
so it stays quiet in busy channels.reply_min_interval_secs: a minimum gap between replies to the same person,
useful if instant responses feel robotic.| Symptom | Likely cause | Fix |
|---|---|---|
| Bot is online but never replies | Message Content Intent is off | Turn it on in the Developer Portal (step 2) and restart |
| Bot replies nowhere | Not invited, or missing View Channels / Send Messages | Re-run the invite (step 4) with the right permissions |
| Bot ignores most messages | mention_only = true | @-mention the bot, or set it to false |
| "Invalid token" at startup | Token mistyped or reset | Reset the token in the portal, set it again (step 3) |