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
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.
/ask your question here. This is the standard Discord UX for bot interactions and requires no gateway connection from ChatSpark.| Action | Description |
|---|---|
| Post Message | Send a message to a Discord channel |
| Post Thread Message | Post a message into an existing thread |
| Create Thread | Start a new thread in a channel with an opening message |
| Get Messages | Fetch recent messages from a channel so the agent is aware of current activity |
| Notify Team | Send an internal alert to a configured channel when a lead or key event occurs |
Before setting up the Discord integration, you'll need:
bot and applications.commands OAuth2 scopesTo allow Discord users to talk to your agent using the /ask command, you must register an Interactions Endpoint URL with Discord.
Discord sends a PING request to verify the endpoint. ChatSpark responds automatically with the correct PONG response, so the validation succeeds right away.
/ask command with Discord globallybot and applications.commandsChannel IDs are required for the Default Channel ID and Notify Channel ID fields. To find a channel ID in Discord:
| Field | Description | Required |
|---|---|---|
| Bot Token | Your Discord bot token (kept encrypted) | Yes |
| Application ID | Your Discord application ID from the General Information tab | Yes |
| Application Public Key | The hex public key from General Information, used to verify incoming requests from Discord | Yes |
| Default Channel ID | Fallback channel used when no channel is specified in a request | No |
| Notify Channel ID | Channel used for internal team alerts via the Notify Team action | No |
After setup, test the integration directly in your Discord server:
/ask followed by a question, such as /ask What are your business hours?You can also test agent-initiated actions through your AI Agent widget:
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 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.
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.
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.
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.
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).