Docs/Channels/Discord
Channels

Discord

Connect your agent to a Discord bot. Inbound uses the raw Discord Gateway WebSocket; outbound uses the Discord REST API v10. Access control is enforced through `allowFrom` only.

Requirements

  • A bot token from the Discord Developer Portal (create an application, add a Bot, copy the token).
  • The Message Content privileged intent enabled for your bot in the Developer Portal (it is part of the default intents value below).

Configuration

Set under channels.discord in ~/.flowly/config.json:

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "...",
      "allowFrom": [],
      "gatewayUrl": "wss://gateway.discord.gg/?v=10&encoding=json",
      "intents": 37377
    }
  }
}
KeyTypeDefaultDescription
enabledboolfalseStart the Discord adapter at gateway boot.
tokenstring""Bot token from the Discord Developer Portal.
allowFromstring[][]Allowed user IDs. Empty = allow all.
gatewayUrlstringwss://gateway.discord.gg/?v=10&encoding=jsonDiscord Gateway WebSocket URL.
intentsint37377Gateway intents bitfield (GUILDS + GUILD_MESSAGES + DIRECT_MESSAGES + MESSAGE_CONTENT).

Connect method

The adapter opens the Discord Gateway WebSocket, sends IDENTIFY with your token and intents, and maintains a heartbeat. It handles HELLO, READY/MESSAGE_CREATE, RECONNECT, and INVALID_SESSION, and auto-reconnects with a 5-second backoff. Messages from bot authors are skipped; attachments up to 20 MB are downloaded to ~/.flowly/media. Outbound replies are sent via POST {API}/channels/{chat_id}/messages with Authorization: Bot <token>, with retry handling for rate limits.

Access control

Discord enforces only

allowFrom (allowed user IDs); an empty list allows everyone. It does not use the pairing store, so flowly pairing approve discord ... has no runtime effect on this adapter β€” manage access via the allowFrom list.

Setup steps

  1. In the Discord Developer Portal, create an application and add a Bot. Copy the token.
  2. Under the Bot settings, enable the Message Content privileged intent.
  3. Invite the bot to your server with the appropriate permissions.
  4. Set channels.discord.enabled to true and paste the token.
  5. Optionally restrict access by adding user IDs to allowFrom.
  6. Start the gateway: flowly gateway.