Skip to main content

Discord

DiscordTeam & Community

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.

Discord channel export showing a connected serverImage: 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

  1. Sign in to the Discord Developer Portal at discord.com/developers.
  2. Click New Application, give it a name (for example, "My Community Agent"), and create it.
  3. In the left menu, open the Bot section.
  4. Click Reset Token (or View Token) and copy the bot token. This is your secure access pass.
  5. Under Privileged Gateway Intents, turn on Message Content Intent so the bot can read messages.

Discord Developer Portal showing the bot tokenImage: Discord Developer Portal showing the bot token

warning

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:

  1. Open OAuth2URL Generator.
  2. Tick the bot scope, then tick the basic message permissions (read messages, send messages, attach files).
  3. Copy the generated URL and open it in your browser.
  4. 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

  1. Open your agent in the Agent Control Panel.
  2. Click the Channels node.
  3. Select Discord from the Team & Community section.
  4. Paste your bot token into the field.
  5. Click Connect.

Your bot comes online and starts replying to messages in any channel it can see.

Pasting the Discord bot token in NirvaiImage: 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

CapabilitySupported
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

ProblemFix
The bot doesn't replyMake 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 offlineThe connection may have dropped — remove it in Nirvai and reconnect with the same bot token.
"Missing permissions" while inviting the botYou need "Manage Server" permission on the Discord server. Ask a server admin to do this step.
"Invalid token" while connectingCopy 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 messagesA long reply may still be in progress — the next message will be picked up as soon as the agent finishes.

What's next