Skip to main content
The Discord interface lets your agent respond to messages in Discord servers and direct messages.

Setup

  1. Create a bot at the Discord Developer Portal
  2. Enable the MESSAGE_CONTENT intent under Bot → Privileged Gateway Intents
  3. Copy the bot token from the Bot settings page
  4. Invite the bot to your server using the OAuth2 URL Generator (select bot scope with Send Messages and Read Message History permissions)

Installation

Quick Example

DiscordInterface Parameters

str
required
Discord bot token from the Developer Portal.
bool
default:true
Enable the MESSAGE_CONTENT privileged intent. Required to read message text.
list[int]
default:"None"
Restrict the bot to specific server (guild) IDs. When None, responds in all servers.
list[int]
default:"None"
Restrict the bot to specific channel IDs. When None, responds in all channels.
bool
default:false
Whether to respond to messages from other bots.
str
default:"None"
When set, the bot only responds to messages starting with this prefix (e.g., "!").
float
Timeout in seconds for the initial connection to Discord.
int
default:2000
Maximum message length. Discord’s limit is 2000 characters. Longer responses are automatically split into multiple messages.

Features

  • Guild and DM support — responds in server channels and direct messages
  • Attachments — receives text, image, and audio files from users
  • Reply context — includes the replied-to message for context
  • Auto message splitting — long responses are split at sentence boundaries
  • Typing indicator — shows “typing…” while the agent processes

Access Control

Restrict which servers and channels the bot responds in:

Agent with Tools and Memory