Discord
Connect Discord text channels and forum channels to answerLoops for automatic AI deflection and ticket tracking.
Your community
answerLoops
What happens next
Overview
answerLoops integrates with Discord at two levels:
- Text channels — every message in a watched channel is ingested as a ticket. The bot replies in the channel when AI confidence is above your threshold and Automatic Deflections is turned on.
- Forum channels — new forum posts create tickets via the
ThreadCreateevent. The initial post is ingested as the ticket body. Replies inside the forum thread also ingest viaMessageCreateand are attached to the same ticket.
Both channel types appear in the unified ticket list with a Discord source badge.
Automatic Deflections is off by default for every newly connected platform. While it's off, even a high-confidence answer is held as a draft on the dashboard awaiting Approve/Edit/Dismiss — Discord gets no automatic reply. Turn it on per-platform in Integrations → Discord once you've reviewed enough approved drafts to trust the AI's answers going out unsupervised.
Cloud setup (recommended)
No Discord Developer Portal access required. answerLoops manages the bot and OAuth app on your behalf.
- In the onboarding wizard (or Integrations → Discord), click "Add answerLoops to Discord"
- Select the server you want to connect in the Discord authorization screen
- Approve the requested permissions and click Authorize
- Back in answerLoops, a channel picker appears showing all text channels and forum channels on your server
- Select the channels where the bot should listen and click Save channels
The bot joins your server immediately. No token to copy, no manifest to upload.
Choosing channels is part of connecting. answerLoops only reads the channels you select, so until you save at least one channel nothing from that server reaches your tickets. A server with no channels saved shows a Needs channels status and the notice "This server does not have any channels connected", and its channel picker opens automatically. If you close the picker, a Connect channels button brings it back. Saving with no channel ticked isn't allowed.
If something goes wrong while connecting, the reason is shown at the top of Integrations → Discord and stays there until you dismiss it. See Troubleshooting for what each message means.
You can return to Integrations → Discord at any time to add or remove channels without re-authorizing.
Connecting multiple servers
You're not limited to one Discord server. Click "Add answerLoops to Discord" again from Integrations → Discord to connect another — each server gets its own card with its own channel picker and its own escalation role, and can be removed independently without affecting the others. A server can only be connected to one answerLoops account at a time; if you try to connect a server that's already linked elsewhere, you'll see an error instead of it silently switching ownership.
Self-hosted setup
This section covers the one-click OAuth flow for self-hosted multi-tenant deployments — anyone in your org authorizes their own server without ever seeing a token. If you just want to connect a single server directly with a bot token and no OAuth app, see Discord Bot Setup instead.
For the OAuth flow, you need to create your own Discord application and configure three environment variables.
1. Create a Discord application
- Go to discord.com/developers/applications and click New Application
- Under Bot, click Add Bot and copy the Bot Token → this is
DISCORD_TOKEN - Under OAuth2 → General, copy the Client ID →
DISCORD_CLIENT_ID - Copy the Client Secret →
DISCORD_CLIENT_SECRET - Add your callback URL to OAuth2 → Redirects:
{AUTH_URL}/api/discord/callback
2. Set required permissions
Under Bot → Privileged Gateway Intents, enable:
- Message Content Intent
Under OAuth2 → URL Generator, select scopes: bot, applications.commands. Select bot permissions: Read Messages/View Channels, Send Messages, Create Public Threads, Read Message History.
3. Configure environment variables
Set these on your app service (not only on the bot service — the app service needs DISCORD_TOKEN for the channel picker to work):
| Variable | Description |
|---|---|
DISCORD_TOKEN | Bot token from the Discord Developer Portal |
DISCORD_CLIENT_ID | Application (client) ID |
DISCORD_CLIENT_SECRET | OAuth2 client secret |
DISCORD_APPLICATION_ID | Same as DISCORD_CLIENT_ID — required for slash commands |
BOT_TARGET_URL | Internal URL the bot uses to reach the app API (no trailing slash) |
4. Register the OAuth callback
Make sure AUTH_URL is set to your public app URL (e.g. https://support.yourcompany.com). Discord will redirect to {AUTH_URL}/api/discord/callback after authorization.
The "Add to Discord" button requests the bot, identify, and guilds scopes. After authorization, answerLoops confirms the server that was authorized, checks that the person who clicked the button owns it or has the Manage Server or Administrator permission there, and checks that the bot is a member. Only org owners and admins can start or complete the flow. DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, and DISCORD_TOKEN must all be set on the app service for the button to appear.
Forum channels
Forum channels work without any extra configuration beyond selecting the channel in the channel picker.
When a user creates a new post in a forum channel:
- answerLoops receives a
ThreadCreateevent - The post's initial message is ingested as a new ticket
- The bot replies in the thread if AI confidence is above threshold
When anyone replies inside that forum thread:
- answerLoops receives
MessageCreateevents for each reply - Replies are attached to the original ticket for full context
Forum channel replies by answerLoops appear inside the thread, not as top-level posts — keeping conversations organized for your community members.
Slash commands
answerLoops supports two slash commands in connected servers:
| Command | What it does |
|---|---|
/ask <question> | Queries the KB and returns an AI answer inline (visible only to the user who ran it) |
/summarize | Summarizes the current thread or recent channel activity |
Slash commands require DISCORD_APPLICATION_ID to be set on the bot service. The bot registers them itself when it starts, so after setting it, restart the bot.
Environment variables reference
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN | Yes (self-host) | Bot token — set on both app and bot services |
DISCORD_CLIENT_ID | Yes (self-host) | OAuth2 client ID |
DISCORD_CLIENT_SECRET | Yes (self-host) | OAuth2 client secret |
DISCORD_APPLICATION_ID | For slash commands | Usually the same value as DISCORD_CLIENT_ID |
BOT_TARGET_URL | Yes (self-host) | URL the bot uses to call the app API — no trailing slash |