Deployments

Deploy to Discord

Add your AI agent to a Discord server so members can chat with it using a slash command.

March 28, 2026
7 min read

Once your agent is deployed, you can connect it to a Discord bot. Server members use the /ask slash command to send messages, and your agent replies directly in the channel.

How It Works

Discord uses an interactions model — your bot registers a slash command (/ask) and Discord sends each interaction to a webhook URL you provide. This means:

  • No persistent WebSocket connection required
  • Users interact via /ask [message] in any channel the bot has access to
  • Conversation memory is maintained per user per channel

Prerequisites

  • An active agent deployment (status must be Active — not draft or paused)
  • A Discord account with permission to create applications at discord.com/developers

Step 1 — Create a Discord Application

  1. Go to discord.com/developers/applications
  2. Click New Application, give it a name, and click Create
  3. From the General Information tab, copy your Application ID and Public Key — you'll need both shortly

Discord developer portal showing the General Information tab with Application ID and Public Key highlighted

Step 2 — Create a Bot

  1. In the left sidebar, click Bot
  2. Click Reset Token (or Add Bot if this is a new app) and confirm
  3. Copy the bot token — you'll need it in the next section

Discord Bot settings page with the token copy button highlighted

[!WARNING] Treat your bot token like a password. Never share it or commit it to source control. If it's exposed, reset it immediately in the Bot settings.

Step 3 — Connect in Deployment Settings

  1. Navigate to your agent and click Deploy Agent
  2. Select your active deployment and open the Discord tab
  3. Fill in all three fields:
    • Bot Token — from Step 2
    • Application ID — from Step 1 (General Information)
    • Public Key — from Step 1 (General Information)
  4. Click Connect Discord Bot

Deployment dialog open on the Discord tab with the three credential fields filled in

After connecting, the system validates your credentials with Discord and registers the /ask slash command globally on your application.

Step 4 — Set the Interactions Endpoint URL

This is the one manual step required by Discord. You need to tell Discord where to send slash command interactions.

  1. After connecting, copy the Interactions Endpoint URL shown in the Discord tab

Discord tab in the connected state showing the Interactions Endpoint URL with a copy button

  1. Back in the Discord developer portal, open your application
  2. Under General Information, paste the URL into the Interactions Endpoint URL field
  3. Click Save Changes — Discord will send a test request to verify the endpoint

Discord General Information page with the Interactions Endpoint URL field filled in and Save Changes highlighted

[!NOTE] Discord verifies the endpoint by sending a PING request. This happens automatically — if the URL is correct and your deployment is active, it will pass immediately.

Step 5 — Invite the Bot to a Server

  1. In the Discord developer portal, go to OAuth2 → URL Generator
  2. Under Scopes, check bot and applications.commands
  3. Under Bot Permissions, select at minimum Send Messages and Use Slash Commands
  4. Copy the generated URL and open it in your browser to invite the bot to your server

OAuth2 URL Generator with bot and applications.commands scopes selected Bot Permissions

Step 6 — Test It

In any channel your bot has access to, type /ask and you'll see the command appear in Discord's autocomplete. Fill in your message and send.

Your agent will respond directly in the channel. If the agent takes more than a second or two, Discord will show a "thinking" indicator until the response is ready.

Test the agent in Discord

Conversation Memory

Conversation context is tracked per user per channel. Two different users in the same channel each get their own separate conversation thread, and the same user asking questions in two different channels also gets separate threads.

This maps to the same memory system used everywhere else — long-term memory applies if enabled on your agent.

Rate Limits

The rate limits and concurrency settings from your deployment apply to Discord interactions. If a user triggers the rate limit, they'll receive a message saying to wait before trying again.

Disconnecting

To remove Discord from a deployment, open the Discord tab and click Disconnect. This removes the stored credentials. The /ask slash command will stop working immediately, though it may still appear in Discord's autocomplete until Discord's cache clears.

[!TIP] You can also delete the slash command directly in the Discord developer portal under Applications → [Your App] → Commands if you want it removed from autocomplete right away.

Supported Interactions

The Discord integration currently handles the /ask slash command only. Direct messages (DMs) to the bot and @mentions in channels are not processed. Standard message monitoring is not supported due to Discord's serverless interaction model.