Skip to content

Repository files navigation

A2A Discord Bot Template

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


⚙️ Setup

  1. Clone the repo:
git clone https://github.com/lekkerelou/kagent-a2a-discord.git
cd kagent-a2a-discord
  1. Create a virtual environment:
uv venv
  1. Install dependencies:
uv sync

🧪 Configuration

Copy the env template and fill in your tokens:

cp .env.example .env

Required ENV vars:

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

🚀 Run the bot

uv run main.py

Or with Python:

python main.py

🐳 Docker

Build & run:

docker build -t a2a-discord-bot .
docker run --env-file .env a2a-discord-bot

📡 Behavior

  • Bot listens to messages in channels
  • Responds to any text unless restricted via DISCORD_MENTION_ONLY or DISCORD_CHANNEL_ONLY
  • Sends reply back with output from your A2A agent

🧠 Powered by

About

Discord bot to interact with A2A Agents on KAgent

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages