Skip to main content

Overview

The Discord integration lets you deploy Nadoo AI agents as Discord bots in your server. Users interact with the bot through channel messages, direct messages, slash commands, and interactive components. The integration supports rich embeds, reactions, button interactions, and file attachments.

Setup

1

Create a Discord Application

  1. Go to the Discord Developer Portal and click New Application.
  2. Give your application a name (e.g., “Nadoo AI Agent”) and click Create.
  3. Note the Application ID from the General Information page.
2

Create a Bot

  1. Navigate to the Bot section in the left sidebar.
  2. Click Add Bot and confirm.
  3. Under the bot’s username, click Reset Token to generate a new token. Copy and save it securely — you will not be able to see it again.
  4. Under Privileged Gateway Intents, enable:
    • Message Content Intent — Required for reading message text
    • Server Members Intent — Optional, for user lookup features
3

Configure Bot Permissions

Navigate to OAuth2 > URL Generator and select the following:Scopes:
  • bot
  • applications.commands
Bot Permissions:
PermissionPurpose
Send MessagesReply to user messages
Read Message HistoryAccess conversation context
Embed LinksSend rich embed responses
Attach FilesShare files with users
Use Slash CommandsRegister and respond to slash commands
Add ReactionsReact to messages
Manage MessagesEdit or delete bot messages (optional)
Copy the generated URL at the bottom of the page.
4

Invite the Bot to Your Server

  1. Open the generated URL in your browser.
  2. Select the server where you want to add the bot.
  3. Authorize the requested permissions.
  4. Complete the CAPTCHA if prompted.
5

Configure in Nadoo AI

In the Nadoo AI platform:
  1. Navigate to your workspace and open Channels.
  2. Click Add Channel and select Discord.
  3. Enter the following credentials:
FieldValue
Bot TokenThe bot token from Step 2
Application IDThe application ID from Step 1
Guild IDYour Discord server ID (right-click server name > Copy Server ID)
WorkflowSelect the workflow to handle Discord messages
  1. Click Save and toggle the channel to Active.
6

Test the Integration

Open Discord, navigate to a channel where the bot has been added, and send a message mentioning the bot or use a slash command. The bot should respond using the configured workflow.

Supported Features

Channel Messages and DMs

FeatureDescription
Channel messagesThe bot responds when mentioned (@bot) or when configured to listen to all messages in specific channels
Direct messagesUsers can DM the bot for private conversations
Thread supportThe bot can create and reply within Discord threads
Conversation historyPrevious messages in the channel or DM are included as context

Slash Commands

Discord slash commands provide a structured way for users to interact with the bot. Nadoo AI automatically registers slash commands when you configure them.
/ask question:How does authentication work?
/search query:refund policy document:policies
/summarize channel:#engineering
Slash command configuration:
{
  "slash_commands": [
    {
      "name": "ask",
      "description": "Ask the AI agent a question",
      "options": [
        {
          "name": "question",
          "type": "string",
          "description": "Your question",
          "required": true
        }
      ]
    },
    {
      "name": "search",
      "description": "Search the knowledge base",
      "options": [
        {
          "name": "query",
          "type": "string",
          "description": "Search query",
          "required": true
        }
      ]
    }
  ]
}

Rich Embeds

The bot sends responses as rich embeds with custom formatting, colors, and fields.
{
  "embed": {
    "title": "Authentication Token Lifecycle",
    "description": "Access tokens expire after 15 minutes. Refresh tokens are rotated on each use.",
    "color": 3447003,
    "fields": [
      { "name": "Access Token TTL", "value": "15 minutes", "inline": true },
      { "name": "Refresh Token TTL", "value": "7 days", "inline": true }
    ],
    "footer": { "text": "Source: auth-architecture.md" }
  }
}
The Discord adapter automatically converts Markdown responses from your workflow into embed format. You can also configure the embed style (color, footer, thumbnail) in the channel settings.

Interactive Components

ComponentDescription
ButtonsAction buttons for user choices (e.g., “Yes / No”, “Show more”)
Select menusDropdown menus for selecting from a list of options
ReactionsThe bot can add reactions to messages and respond to user reactions

File Handling

FeatureDescription
File attachmentsUsers can attach files. The bot can process documents, images, and other supported formats.
File responsesThe bot can send files back to the user (reports, exports, generated content)

Guild Permissions

Control which channels and roles can interact with the bot using Discord’s native permission system.

Channel Restrictions

Restrict the bot to specific channels by configuring channel permissions in Discord:
  1. Go to the channel’s settings > Permissions.
  2. Add the bot role and set the desired permissions.
  3. Deny permissions in channels where the bot should not operate.
Alternatively, configure allowed channels in the Nadoo AI channel settings:
{
  "allowed_channels": ["general", "support", "engineering"],
  "ignored_channels": ["random", "off-topic"]
}

Role-Based Access

Restrict bot interactions to specific Discord roles:
{
  "allowed_roles": ["Team Member", "Admin"],
  "admin_roles": ["Admin"]
}
Users with admin_roles can access additional commands like /config and /status.

Rate Limits and Best Practices

Discord API Rate Limits

Discord enforces rate limits per route. Nadoo AI’s delivery queue handles these automatically.
RouteRate Limit
Send message (per channel)5 messages per 5 seconds
Edit message5 edits per 5 seconds
Global50 requests per second
Slash command registration200 per day per guild

Best Practices

Slash commands provide autocomplete, parameter validation, and a better user experience than parsing free-form messages. Define commands for your most common agent interactions.
For sensitive information, configure the bot to send ephemeral messages that are only visible to the requesting user. Set ephemeral: true in the response configuration.
Embeds are more readable than plain text for structured data. Use fields for key-value pairs, footers for source citations, and color coding for response categories.
Create a dedicated channel for bot interactions (e.g., #ai-assistant) to avoid cluttering other channels. Users who want to interact with the bot can go to that channel.

Troubleshooting

IssueSolution
Bot is offline in DiscordVerify the bot token is correct and the channel is Active in Nadoo AI
”Missing Permissions” errorCheck that the bot has the required permissions in the target channel
Slash commands not showingCommands can take up to 1 hour to propagate globally. Use guild-specific commands for instant registration.
Message Content Intent errorEnable the Message Content Intent in the Discord Developer Portal under Bot > Privileged Gateway Intents

Next Steps