Sophon Docs
Channels

Discord

Connect Sophon to Discord as a bot.

Sophon connects to Discord using the official Bot API. You'll create an application in the Discord Developer Portal, add a bot, and invite it to your server.

Prerequisites

  • A Discord account
  • A Discord server where you have Manage Server permission

Step-by-Step Setup

1. Create a Discord Application

  1. Go to the Discord Developer Portal
  2. Click New Application
  3. Name it (e.g., "Sophon") and click Create

2. Create a Bot User

  1. In your application, go to Bot in the left sidebar
  2. Click Reset Token and copy the token — you won't see it again
  3. Under Privileged Gateway Intents, enable:
    • Message Content Intent (required to read message text)
    • Server Members Intent (optional, for member info)

3. Generate an Invite URL

  1. Go to OAuth2 > URL Generator
  2. Under Scopes, select bot
  3. Under Bot Permissions, select:
    • Send Messages
    • Read Message History
    • Attach Files
    • Embed Links
    • Add Reactions
    • Use Slash Commands (optional)
  4. Copy the generated URL and open it in your browser
  5. Select your server and click Authorize

4. Configure in Sophon Dashboard

  1. Go to Channels and click Add Channel
  2. Select Discord
  3. Paste the bot token
  4. Click Test Connection
  5. Click Activate

5. Test It

Mention the bot or send a DM in Discord. Sophon should respond.

Configuration Reference

FieldTypeRequiredDescription
botTokensecretYesBot token from Developer Portal > Bot > Reset Token

channels.json Example

{
  "id": "discord-bot",
  "type": "discord",
  "name": "Sophon Discord Bot",
  "enabled": true,
  "config": {
    "botToken": "<encrypted>"
  },
  "routing": {
    "agentId": "default",
    "dmBehavior": "main-session",
    "groupBehavior": "mention-only"
  },
  "status": "connected"
}

Permissions

The minimum required permissions for Sophon to function:

PermissionPurpose
Send MessagesReply to users
Read Message HistoryRead conversation context
Attach FilesSend file attachments
Embed LinksFormat rich responses
Add ReactionsReact to messages

Troubleshooting

  • "Used disallowed intents" — You forgot to enable Message Content Intent in the Developer Portal under Bot > Privileged Gateway Intents. Enable it and restart the channel.
  • Bot is online but doesn't respond — Make sure the bot has Send Messages and Read Message History permissions in the channel. Check the channel's permission overwrites.
  • Bot doesn't see messages in a channel — The bot needs access to the channel. Check that the bot's role has the View Channel permission for the target channel.
  • "Token is invalid" — Bot tokens can only be viewed once after reset. Go to Developer Portal > Bot > Reset Token to generate a new one.
  • Rate limited — Discord enforces rate limits. If the bot sends too many messages, responses may be delayed. Adjust rateLimits.maxMessagesPerMinute in the channel config.