Copy
Ask AI
"""
Discord Agent With Media
========================
Runs a Discord bot that can analyze user-provided media.
"""
from agno.agent import Agent
from agno.integrations.discord import DiscordClient
from agno.models.google import Gemini
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
media_agent = Agent(
name="Media Agent",
model=Gemini(id="gemini-3-flash-preview"),
description="A Media processing agent",
instructions="Analyze images, audios and videos sent by the user",
add_history_to_context=True,
num_history_runs=3,
add_datetime_to_context=True,
markdown=True,
)
discord_agent = DiscordClient(media_agent)
# ---------------------------------------------------------------------------
# Run Discord Bot
# ---------------------------------------------------------------------------
if __name__ == "__main__":
discord_agent.serve()
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/92_integrations/discord
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python agent_with_media.py