Intelligent Discord bot that uses AI to automate server management tasks. Tell it what you want, and it automatically creates roles, channels, handles moderation, and more!
- Natural Language Commands: Just describe what you want ("Create a moderator role")
- AI-Powered Planning: Uses OpenAI/OpenRouter to understand your intent
- Automated Execution: Automatically creates roles, channels, manages permissions
- Safe Operations: All actions require "Manage Server" permission
- Extensible: Easy to add new action types
- Python 3.9+ - Download from https://python.org
- Discord Bot Token - Create at https://discord.com/developers/applications
# Install dependencies
pip install -r requirements.txt
# Edit config/.env with your tokens
# DISCORD_BOT_TOKEN=your_token_here
# DISCORD_APP_ID=your_app_id_here
# OPENAI_API_KEY=your_api_key_here- Go to https://discord.com/developers/applications
- Select your app → OAuth2 → URL Generator
- Select:
bot,applications.commands - Permissions:
Manage Roles,Manage Channels,Manage Guild,Send Messages - Open the generated link to invite bot to your server
Terminal 1 - Backend API:
python main.py --mode backendTerminal 2 - Discord Bot:
python main.py --mode botIn Discord, type:
/ping
Then try:
/orchestrate Create a moderation team with a mod role and mod-log channel
- QUICKSTART.md - 5-minute setup guide
- DISCORD_SETUP.md - Detailed Discord configuration steps
- validate.py - Run to check if everything is set up
You in Discord
↓
/orchestrate "Create a mod role"
↓
Discord Bot (discord.py)
↓ (HTTP POST)
FastAPI Backend
↓
AI Agent (LangChain)
↓
Generates action plan
↓
Discord API (Creates role, channel, etc.)
↓
Result back to Discord
/orchestrate Create a moderation team with admin and mod roles
/orchestrate Ban user 123456789 for breaking rules
/orchestrate Create a private support channel
/orchestrate Archive inactive channels
-
Create Discord Application
- Go to Developer Portal
- Create new app and bot
- Copy
DISCORD_BOT_TOKENandDISCORD_APP_ID→config/.env
-
Get API Key
- Go to OpenRouter.ai or OpenAI
- Create API key
- Copy to
config/.envasOPENAI_API_KEY
-
Install Dependencies
pip install -r requirements.txt
-
Invite Bot to Server
- DevPortal → OAuth2 → URL Generator
- Select
bot,applications.commands - Permissions:
Manage Roles,Manage Channels,Manage Guild,Send Messages - Open URL and select your server
-
Run Backend (Terminal 1)
python main.py --mode backend
-
Run Bot (Terminal 2)
python main.py --mode bot
-
Test
/ping
Check if everything is set up correctly:
python validate.pybot/ → Discord bot commands
backend/ → FastAPI API server
agent/ → AI planning logic
config/ → Settings & .env
main.py → Entry point
validate.py → Setup checker
requirements.txt → Python packages
| Issue | Solution |
|---|---|
| Bot not responding | Check Terminal 2 is running, bot has permissions |
| "Failed to process request" | Check Terminal 1 backend is running |
| API key error | Verify key format: sk-or-v1- or sk- |
| Missing permissions | Move bot role above others in server roles |
discord.py- Bot frameworkfastapi- API serverlangchain- AI orchestrationopenai- LLM APIpydantic- Data validationhttpx- HTTP clientpython-dotenv- Environment config
- Run
python validate.py- Check setup - Read QUICKSTART.md - Get started in 5 min
- Follow DISCORD_SETUP.md - Configure Discord
- Run the bot!
Let's automate your Discord server! 🎉