Create and invite the bot
- Create an application in the Discord Developer Portal.
- Open Bot, generate/reset the token, and copy it privately. Reset an exposed token immediately.
- Enable Message Content Intent for normal server-message processing. Enable other privileged intents only when the features you use need them.
- In the OAuth2 URL Generator, select
botandapplications.commands. Grant the permissions your bot needs, including View Channels, Send Messages and Read Message History; media and threads need additional permissions. - Open the generated invite URL and authorize it for your server.
Connect it to OpenClaw
During installation, paste the token into Discord bot token. For an existing install, setDISCORD_BOT_TOKEN as a sensitive value in Variables, then click Apply changes. This redeploys the app and interrupts its connection; there is no Channels multiselect.
If a token is already stored in OpenClaw’s own configuration, check it too: it can override the environment value.
Verify and approve access
Once the bot is online, send it a direct message. With the default pairing policy, approve your own account from the OpenClaw Terminal:PAIRING_CODE with the code belonging to a sender you recognize. Allow bot DMs in Discord’s privacy settings if needed. Channel pairing is separate from Control UI browser approval.
For server conversations, configure the permitted server/channel IDs and sender policies in OpenClaw. Test with an explicit bot mention. Discord permissions alone do not grant access through OpenClaw’s allowlists. See Discord access configuration.
Troubleshooting
- Offline: check the token, both running states, outbound connectivity and gateway/intents errors in Logs.
- Online but silent: check sender pairing, server/channel allowlists, mention requirements, permissions, model access and Message Content Intent.
- Only some channels fail: inspect channel/category permission overrides and OpenClaw’s channel configuration.
- Slow or failed replies: inspect API rate-limit errors and the model provider. Follow the retry delay reported by the service; there is no fixed cooldown guarantee.