Discord Bridge

The Discord bridge connects Hefty to Discord, allowing users to interact with the AI agent through a Discord bot in specific channels or via direct messages. Messages from Discord are relayed into Hefty as conversations, and responses are sent back to the originating Discord channel or DM.

Prerequisites

  • A Discord Bot Token — obtained by creating a bot application in the Discord Developer Portal.
  • The bot must be invited to the target server with the Send Messages and Read Message History permissions.
  • The Server ID of the Discord server the bot operates in.

See Creating a Discord Bot below for step-by-step instructions on creating a bot, obtaining the token, inviting it to a server, and finding your Server ID.

Creating a Discord Bot

This section walks through creating a Discord bot application, obtaining the bot token, and inviting the bot to a server. If you already have a bot token and the bot is in your server, skip ahead to Configuration.

  1. Go to the Discord Developer Portal and sign in.
  2. Click the New Application button and give it a name.
  3. Navigate to the Bot page in the left sidebar.
  4. Click Reset Token (or Add Bot if this is a new application) and confirm. Copy the bot token and save it securely — this is used in the Configuration section below.
  5. On the same Bot page, under Privileged Gateway Intents, enable the Message Content Intent toggle. This is required for the bot to read message content.
  6. Under the same Bot page (or the OAuth2 page depending on Developer Portal version), note the required permissions: Send Messages and Read Message History. These permissions will be configured when generating the invite URL in the next subsection.
Privileged Intents

The Message Content Intent is a privileged intent that must be explicitly enabled. Without it, the bot will not be able to read the content of messages, and bridging will not work. Discord may require verification for bots in over 100 servers to use privileged intents.

Inviting the Bot

To add the bot to a server, you need to generate an invite URL with the bot scope.

  1. In the Developer Portal, open your application and go to OAuth2 → URL Generator (or the Installation page).
  2. Under Scopes, select bot.
  3. Under Bot Permissions, select Send Messages and Read Message History.
  4. Copy the generated URL at the bottom of the page.
  5. Open the URL in a browser, select the target server from the dropdown, and authorize the bot.

The bot should now appear in the server's member list.

Finding Your Server ID

The Server ID is needed for configuration and requires enabling Developer Mode in Discord.

  1. Open Discord and go to User Settings (the gear icon next to your username).
  2. Navigate to Advanced under App Settings.
  3. Enable Developer Mode.
  4. Right-click (or long-press) on the server name in the server list.
  5. Select Copy Server ID from the context menu. The copied value is the Server ID used in the Configuration section.

For further reading, see the official Discord Getting Started guide.

Configuration

Open User Menu → Chat Bridges, select the Discord tab, and fill in the following fields:

  • Bot Token — the token from your Discord bot application. This field is masked by default; use the show/hide toggle to verify the value.
  • Server ID — the ID of the Discord server the bot operates in.
Protect Your Bot Token

Your Discord bot token grants full control over the bot. Never share it in logs, screenshots, or unencrypted messages.

Testing the Connection

After entering your bot token and server ID, click the Test button to verify the connection. On success, you'll see a confirmation message that includes the bot's Discord username. On failure, an error message will describe what went wrong (e.g., invalid token, missing permissions, server not found).

How It Works

Once the bridge is running, messages sent in channels the bot has access to (or via direct message to the bot) are relayed into Hefty as bridge conversations. These conversations appear in the Conversations sidebar with a DC source badge.

Hefty processes the incoming message through its normal cognition pipeline and sends the response back to the originating Discord channel or DM. Each Discord user is tracked individually, so conversations remain separate.

Message Flow

  1. A user sends a message in a Discord channel the bot has access to, or DMs the bot directly.
  2. The Discord bridge receives the message through the Discord gateway.
  3. The message is relayed into Hefty and processed as a bridge conversation.
  4. Hefty's response is sent back to the originating Discord channel or DM.