answerLoopsanswerLoopsDocs

Discord

Connect Discord text channels and forum channels to answerLoops for automatic AI deflection and ticket tracking.

Your community

answerLoops

What happens next

Replies and escalation mentions appear in the same Discord channel or thread
Your Discord server. A member posts in a text channel you selected, or starts a post in a forum channel. The answerLoops bot sits in your server and replies there.

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 ThreadCreate event. The initial post is ingested as the ticket body. Replies inside the forum thread also ingest via MessageCreate and 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.


No Discord Developer Portal access required. answerLoops manages the bot and OAuth app on your behalf.

  1. In the onboarding wizard (or Integrations → Discord), click "Add answerLoops to Discord"
  2. Select the server you want to connect in the Discord authorization screen
  3. Approve the requested permissions and click Authorize
  4. Back in answerLoops, a channel picker appears showing all text channels and forum channels on your server
  5. 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

  1. Go to discord.com/developers/applications and click New Application
  2. Under Bot, click Add Bot and copy the Bot Token → this is DISCORD_TOKEN
  3. Under OAuth2 → General, copy the Client ID → DISCORD_CLIENT_ID
  4. Copy the Client Secret → DISCORD_CLIENT_SECRET
  5. 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):

VariableDescription
DISCORD_TOKENBot token from the Discord Developer Portal
DISCORD_CLIENT_IDApplication (client) ID
DISCORD_CLIENT_SECRETOAuth2 client secret
DISCORD_APPLICATION_IDSame as DISCORD_CLIENT_ID — required for slash commands
BOT_TARGET_URLInternal 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 ThreadCreate event
  • 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 MessageCreate events 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:

CommandWhat it does
/ask <question>Queries the KB and returns an AI answer inline (visible only to the user who ran it)
/summarizeSummarizes 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

VariableRequiredDescription
DISCORD_TOKENYes (self-host)Bot token — set on both app and bot services
DISCORD_CLIENT_IDYes (self-host)OAuth2 client ID
DISCORD_CLIENT_SECRETYes (self-host)OAuth2 client secret
DISCORD_APPLICATION_IDFor slash commandsUsually the same value as DISCORD_CLIENT_ID
BOT_TARGET_URLYes (self-host)URL the bot uses to call the app API — no trailing slash

Troubleshooting

On this page