cookbook/92_integrations/discord/README.md
This module provides a Discord client implementation for Agno, allowing you to create AI-powered Discord bots using Agno's agent framework.
Before you can use the Discord client, you'll need:
uv pip install discord.py agno
Create a Discord bot:
Set up your environment:
.envrc file in your project rootDISCORD_TOKEN=your_bot_token_here
Invite Your Bot to Your Discord Server:
bot scopeHere's a basic example of how to use the DiscordClient:
from agno.agent import Agent
from agno.integrations.discord import DiscordClient
from agno.models.anthropic import Claude
# Create your agent
agent = Agent(
model=Claude(id="claude-3-7-sonnet-latest"),
instructions=["Your agent instructions here"],
# Add other agent configurations as needed
)
# Initialize the Discord client
discord_agent = DiscordClient(media_agent)
if __name__ == "__main__":
discord_agent.serve()
The DiscordClient accepts the following parameters:
agent: An Agno Agent instance that will handle the bot's responsesIf you encounter any issues or have questions, please: