Chatspark
K
K

Discord

Enable your AI agent to post messages to Discord channels, create threads, fetch recent messages, and alert your team — all through natural conversation.

8 min read

Updated August 2026

Overview

The Discord integration connects your AI agent to your Discord server. Once configured, your agent can post messages to any channel it has access to, create and participate in threads, and read recent messages to stay aware of what is happening in your community.

Discord users can also interact with your agent directly using the /ask slash command. Type /ask followed by your message in any channel where the bot is present, and the agent responds inline. This works through Discord's HTTP Interactions system, which does not require a persistent WebSocket connection.

Slash Commands, Not Mentions
Discord's HTTP Interactions endpoint responds to slash commands, not raw @mentions. Users interact with your agent using /ask your question here. This is the standard Discord UX for bot interactions and requires no gateway connection from ChatSpark.

Available Actions

ActionDescription
Post MessageSend a message to a Discord channel
Post Thread MessagePost a message into an existing thread
Create ThreadStart a new thread in a channel with an opening message
Get MessagesFetch recent messages from a channel so the agent is aware of current activity
Notify TeamSend an internal alert to a configured channel when a lead or key event occurs
Two Directions
Most actions let your agent post content to Discord. Notify Team posts to a designated staff channel and is labeled “Internal Use” in the action library to make that distinction clear.

Prerequisites

Before setting up the Discord integration, you'll need:

  • A Discord account with permission to manage a server
  • A Discord application and bot created in the Discord Developer Portal
  • Your Bot Token, Application ID, and Application Public Key from the Developer Portal
  • The bot invited to your server with the bot and applications.commands OAuth2 scopes

Setup Instructions

Step 1: Create a Discord Application

  1. Go to the Discord Developer Portal
  2. Click New Application and give it a name (for example, your chatbot name)
  3. On the General Information tab, copy your Application ID and Public Key

Step 2: Create a Bot and Get Your Token

  1. In the Developer Portal, go to the Bot section
  2. Click Add Bot if prompted, or find the token section
  3. Click Reset Token to generate a new bot token, then copy it immediately
  4. Make sure Message Content Intent is enabled if you need the agent to read message content
Keep Your Bot Token Private
Your bot token gives full control over your Discord bot. Never share it publicly, commit it to version control, or include it in client-side code.

Step 3: Enable in ChatSpark

  1. In ChatSpark, go to AI Actions
  2. Find Discord in the Library and click Enable
  3. Select the agent that should have access
  4. Enter your Bot Token, Application ID, and Application Public Key
  5. Optionally, enter a Default Channel ID and a Notify Channel ID
  6. Click Test in Sandbox to verify your credentials
  7. Click Save

Step 4: Set the Interactions Endpoint URL

To allow Discord users to talk to your agent using the /ask command, you must register an Interactions Endpoint URL with Discord.

  1. After saving the action, open it again to find the Interactions Endpoint URL shown in the Discord Setup section
  2. Copy the URL
  3. In the Discord Developer Portal, go to General Information
  4. Paste the URL into the Interactions Endpoint URL field
  5. Click Save Changes

Discord sends a PING request to verify the endpoint. ChatSpark responds automatically with the correct PONG response, so the validation succeeds right away.

Step 5: Register the Slash Command

  1. In ChatSpark, open your Discord AI Action settings
  2. Click Register Slash Command
  3. ChatSpark registers the /ask command with Discord globally
  4. The command appears in Discord servers where the bot has been invited within a few minutes
Register Once
You only need to register the slash command once. Discord treats this registration as an upsert, so clicking the button again is safe and will not create duplicates.

Step 6: Invite the Bot to Your Server

  1. In the Developer Portal, go to OAuth2URL Generator
  2. Under Scopes, select bot and applications.commands
  3. Under Bot Permissions, select Send Messages, Create Public Threads, and Read Message History
  4. Copy the generated URL and open it in your browser
  5. Select your server and click Authorize

Finding Channel IDs

Channel IDs are required for the Default Channel ID and Notify Channel ID fields. To find a channel ID in Discord:

  1. Open Discord and go to User SettingsAdvanced
  2. Enable Developer Mode
  3. Right-click any channel and select Copy Channel ID

Configuration Fields

FieldDescriptionRequired
Bot TokenYour Discord bot token (kept encrypted)Yes
Application IDYour Discord application ID from the General Information tabYes
Application Public KeyThe hex public key from General Information, used to verify incoming requests from DiscordYes
Default Channel IDFallback channel used when no channel is specified in a requestNo
Notify Channel IDChannel used for internal team alerts via the Notify Team actionNo

Testing Your Integration

After setup, test the integration directly in your Discord server:

  1. Go to a channel where the bot is present
  2. Type /ask followed by a question, such as /ask What are your business hours?
  3. The bot shows a loading indicator, then posts your agent's response

You can also test agent-initiated actions through your AI Agent widget:

  • Post Message: “Post an announcement to Discord” or “Send this to the Discord channel”
  • Post Thread Message: “Reply in the Discord thread” or “Continue that thread in Discord”
  • Create Thread: “Create a Discord thread about this” or “Start a new thread in Discord”
  • Get Messages: “What was said in Discord recently?” or “Show me the latest Discord messages”
  • Notify Team: Fires automatically when a lead is captured. No customer trigger phrase is needed.

Troubleshooting

Bot Token is invalid

Use Test in Sandbox to validate your credentials before saving. If the test fails with an authentication error, regenerate your bot token in the Developer Portal under the Bot section and update it in ChatSpark.

Discord could not verify the Interactions Endpoint URL

Discord sends a PING when you save the Interactions Endpoint URL. If verification fails, confirm the URL is copied exactly as shown in ChatSpark without any trailing spaces. Also make sure the Application Public Key in the ChatSpark configuration matches the value on the General Information tab of your Discord application.

Slash command does not appear in the server

After clicking Register Slash Command, global commands can take up to a few minutes to propagate. If the command still does not appear, confirm the bot has the applications.commands OAuth2 scope and has been invited to the server using that scope.

Messages fail with a Missing Permissions error

The bot must have Send Messages permission in the target channel. Check the channel permissions in Discord and make sure the bot role is not blocked. For threads, the bot also needs Create Public Threads permission.

Response is cut off at 2000 characters

Discord has a 2000-character limit per message. ChatSpark automatically truncates responses that exceed this limit. If your agent's responses are consistently hitting the limit, consider adjusting your agent's instructions to keep replies more concise.

Channel not found

Verify the channel ID is correct and that the bot is a member of the server containing that channel. The bot cannot post to channels in servers it has not been invited to. Use Discord's Developer Mode to copy accurate channel IDs (see the Finding Channel IDs section above).

Discord Support
For questions about your Discord application or bot configuration, visit the Discord Developer Documentation.

Previous

Dynamics 365

Next

FireHydrant