Host agents as Discord Bots.
Prerequisites
Create a Discord Application
Create a Bot User
Configure Bot Permissions and Intents
Setup Environment Variables
.envrc
file in your project root with the following content, replacing the placeholder with your actual bot token:direnv allow
).Install Required Packages
Invite Bot to Your Discord Server
bot
applications.commands
(if using slash commands)Test Your Bot
DiscordClient
, and run it:
DiscordClient
: Wraps Agno agents/teams for Discord integration using discord.py.DiscordClient.serve
: Starts the Discord bot client with the provided token.DiscordClient
ClassParameter | Type | Default | Description |
---|---|---|---|
agent | Optional[Agent] | None | Agno Agent instance. |
team | Optional[Team] | None | Agno Team instance. |
agent
or team
, not both.
{username}'s thread
Image
objects with URLsVideo
objects with contentAudio
objects with URLsFile
objects with content[1/3] message content
export DISCORD_BOT_TOKEN="your-token"
python your_discord_bot.py