Discord
Adding your agent to Discord is like inviting a new member into your community who's always around to answer questions. Members chat with the agent in a channel, and it replies automatically. This page shows you how to create a Discord bot and add it to your server.
Image: Discord channel export showing a connected server
Before you start
- A saved agent in the Agent Control Panel (at least the Profile step completed).
- A Discord server — the community space where your channels and members live.
- "Manage Server" or admin permission on that server.
- A bot token — a secure access pass from your Discord application that lets Nirvai control your bot. You'll create this in the next step.
Step-by-step
1. Create the bot on Discord
- Sign in to the Discord Developer Portal at discord.com/developers.
- Click New Application, give it a name (for example, "My Community Agent"), and create it.
- In the left menu, open the Bot section.
- Click Reset Token (or View Token) and copy the bot token. This is your secure access pass.
- Under Privileged Gateway Intents, turn on Message Content Intent so the bot can read messages.
Image: Discord Developer Portal showing the bot token
Keep your bot token private. Anyone who has it can control your bot — treat it like a password. If you ever paste it somewhere by mistake, click Reset Token to revoke it.
2. Add the bot to your server
Still in the Developer Portal:
- Open OAuth2 → URL Generator.
- Tick the bot scope, then tick the basic message permissions (read messages, send messages, attach files).
- Copy the generated URL and open it in your browser.
- Choose your server and click Authorize.
The bot now appears in your server's member list (it'll show as offline until you finish the next step).
3. Connect the bot to Nirvai
- Open your agent in the Agent Control Panel.
- Click the Channels node.
- Select Discord from the Team & Community section.
- Paste your bot token into the field.
- Click Connect.
Your bot comes online and starts replying to messages in any channel it can see.
Image: Pasting the Discord bot token in Nirvai
What happens after you connect
- When someone posts in a channel the bot has access to, Discord hands the message to Nirvai, your agent reads it, and the reply appears in the same channel.
- The agent finishes its current reply before starting the next one — extra messages line up and are answered in order.
- If a member sends an image or a file, the agent just answers — no extra "uploaded" confirmation message.
What your agent can do on Discord
| Capability | Supported |
|---|---|
| Reply to channel messages | ✓ |
| Send text messages | ✓ |
| Send images | ✓ |
| Send files | ✓ |
| Send rich message cards | ✓ |
Managing your connection
- Remove disconnects Discord from your agent. The bot stays in your server but goes offline until you reconnect.
- To rotate the bot token, click Reset Token in the Developer Portal, then paste the new token into Nirvai.
Troubleshooting
| Problem | Fix |
|---|---|
| The bot doesn't reply | Make sure the bot has permission to read and send messages in that channel, and that Message Content Intent is turned on in the Developer Portal. |
| The bot shows as offline | The connection may have dropped — remove it in Nirvai and reconnect with the same bot token. |
| "Missing permissions" while inviting the bot | You need "Manage Server" permission on the Discord server. Ask a server admin to do this step. |
| "Invalid token" while connecting | Copy the token again — there's no space at the start or end. If you regenerated it, the previous one stopped working. |
| The bot replies but skips messages | A long reply may still be in progress — the next message will be picked up as soon as the agent finishes. |
What's next
- See every place your agent can show up in the Channels overview.
- Set up a public bot in Telegram or a workspace assistant in Slack.