Skip to content

Connect a Discord bot and one of your agents will reply to DMs and to messages in servers it's invited to. Frona uses Discord's Gateway (WebSocket) connection, so the engine does not need a public URL.

What you need

  • A Discord account
  • An application + bot from the Discord Developer Portal
  • A server (guild) you can manage (required to invite the bot)

No public URL is required.

Creating the bot

  1. Go to the Discord Developer Portal and click New Application. Name it.
  2. Open the Bot tab. Optionally set a username and avatar.
  3. Under Privileged Gateway Intents, enable MESSAGE CONTENT INTENT. Without this, the bot only sees mentions and DM content.
  4. Click Reset Token and copy the bot token. You'll paste this into Frona. This token is shown once. Store it somewhere safe.
  5. Open OAuth2 → URL Generator:
    • Scopes: bot
    • Bot Permissions: at minimum Read Messages/View Channels, Send Messages, Read Message History. Add Send Messages in Threads if you want thread replies.
  6. Copy the generated URL, open it in a browser, and invite the bot to your server.

Connecting the channel

Connection happens in two stages. A short dialog creates the channel, then the channel's detail page is where you paste the bot token (via Frona's vault).

Step 1: Create the channel

  1. In Frona, open Settings → Channels and click Add channel.
  2. Pick Discord from the provider list. The create dialog opens.
  3. Fill in the dialog:
    • Space. Defaults to Discord. This is the space the conversation will live in. Keep the default to create a new space with that name, type any other name to create a different one, or pick an existing space from the dropdown. A space can host only one channel, so spaces already bound to another channel are hidden.
    • Agent. The agent that reads every incoming message and sends the reply.
    • When a message arrives. How inbound messages are handled:
      • Treat as a message from you (default). The agent runs full inference and replies. Until the channel is paired to your Discord user, only your own messages pass.
      • Hand off to a waiting agent. The message goes to whichever task is currently waiting on a signal. The agent does not reply on this channel. See Signals.
  4. Click Create.

You land on the channel detail page. The status is Setup until the bot token is configured.

Step 2: Configure the bot token

Open the Config tab on the channel detail page. The Provider Config panel lists bot_token. It's a secret, so it's set via Frona's credential picker rather than a raw text field.

  1. Click Configure next to bot_token.
  2. Pick a vault connection. You can use a configured password manager (1Password, Bitwarden, HashiCorp Vault, KeePass) or Local to keep the secret in Frona's encrypted store.
  3. Either pick an existing vault item, or click New credential to create one. For Local, choose API key, name it (e.g., discord-bot-token), and paste the bot token.
  4. Pick the field on the item that holds the token.
  5. Click Save in the dialog.

After the token is configured, click Save at the top of the channel page. The adapter opens a Gateway connection and the channel transitions to Connected.

Step 3: Pair your Discord account

By default the channel doesn't trust any sender, so even your own messages are ignored. Pair the channel to your Discord account so the agent treats you as a self-source:

  1. On the channel detail page, click Pair. A short code appears (e.g. XYZ-123).
  2. DM the bot the code from your own Discord account, or @mention it with the code in a server channel the bot can see.
  3. The channel records your Discord user ID as a paired address and the conversation goes live.

From then on, messages from that account pass the default receive_message policy and the agent replies. To pair another account, click Re-pair and repeat. To let other users in the server through, add a policy.

Configuration fields

FieldRequiredDescription
bot_tokenYesBot token from the Developer Portal (Applications → your app → Bot → Reset Token). Stored encrypted.

How messages flow

  • DMs to the bot run full inference and the agent replies in the same DM.
  • Server messages are delivered when the bot has channel access and the MESSAGE CONTENT INTENT is enabled. Without that intent, only messages that mention the bot (or that it's replied to) carry content.
  • Replies are sent back to the same Discord channel, threaded if the original was in a thread.
  • Markdown is rendered into Discord's markdown.

Allowlisting senders

By default only your own Discord user passes receive_message. To allow another user, add a policy:

cedar
permit(
  principal == Policy::Agent::"assistant",
  action == Policy::Action::"receive_message",
  resource in Policy::Channel::"discord"
) when { resource.sender.address == "123456789012345678" };

The address is the Discord user ID (right-click a user in Discord with Developer Mode on, Copy User ID). See Policies for channel-wide allows and blocks.

Tips

  • Enable Message Content Intent. Without it, the bot is essentially deaf in server channels except for mentions. This is the most common Discord setup mistake.
  • Use one bot per agent. Bot tokens are per-application and the bot's name/avatar is what users see.
  • Server admins control where the bot can read. If a user complains "the bot doesn't reply in #general", check the channel's role permissions for the bot.
  • Treat the token like a password. Anyone with it can impersonate your bot. If it leaks, reset it in the Developer Portal.

Troubleshooting

SymptomLikely cause
Channel marked Failed right after creationBad bot token, or the bot was deleted in the Developer Portal.
Bot is online but messages in channels are empty / ignoredMessage Content Intent is not enabled, or the bot lacks Read Message History in that channel.
Bot doesn't respond to DMsSome users have "Allow direct messages from server members" disabled. They need to be in a server with the bot and allow DMs from members.
Replies appear in the wrong placeMake sure the bot has Send Messages in the target channel. Discord silently drops sends in channels where it lacks the scope.

Next steps

  • Channels. How channels work in general.
  • Policies. Allow specific users or servers.