This is a simple template for a Discord bot using A2A to connect with kagent.
🌀 Forked and reworked from the original Slack bot template
Now fully adapted for Discord via discord.py
GitHub: https://github.com/lekkerelou/kagent-a2a-discord
- Clone the repo:
git clone https://github.com/lekkerelou/kagent-a2a-discord.git
cd kagent-a2a-discord- Create a virtual environment:
uv venv- Install dependencies:
uv syncCopy the env template and fill in your tokens:
cp .env.example .env| Variable | Description |
|---|---|
DISCORD_BOT_TOKEN |
Your Discord bot token |
KAGENT_A2A_URL |
URL of your A2A agent endpoint |
DISCORD_MENTION_ONLY |
(optional) Set to true to respond only when mentioned |
DISCORD_CHANNEL_ONLY |
(optional) Comma-separated list of allowed channel IDs |
uv run main.pyOr with Python:
python main.pyBuild & run:
docker build -t a2a-discord-bot .
docker run --env-file .env a2a-discord-bot- Bot listens to messages in channels
- Responds to any text unless restricted via
DISCORD_MENTION_ONLYorDISCORD_CHANNEL_ONLY - Sends reply back with output from your A2A agent