A powerful Discord AI bot with per-user memory persistence, multiple AI providers, and a modern UI.
- 🧠 Per-User Memory: Each user has isolated conversation history stored in SQLite
- 🤖 Multiple AI Providers: Google Gemini, Groq, and OpenRouter support
- 🎨 Modern UI: Rich embeds with gradient colors and interactive menus
- 🖼️ Multimodal: Image understanding with Gemini models
- 📺 YouTube Integration: Automatic transcript extraction
- 🔄 Auto-Failover: Automatic provider switching on errors
- 🛡️ Admin Commands: Full moderation suite (kick, ban, timeout, etc.)
Discord AI/
├── src/
│ ├── __init__.py
│ ├── bot.py # Main bot class
│ ├── commands.py # Slash commands
│ ├── providers.py # AI provider implementations
│ ├── ui_components.py # Modern Discord UI components
│ ├── database.py # SQLite database manager
│ └── utils.py # Utility functions
├── config/
│ ├── config.json # Bot configuration
│ ├── models.json # Available AI models
│ ├── instruction.json # System instructions
│ └── Admin.json # Admin directives
├── data/
│ └── user_dbs/ # Per-user SQLite databases
├── logs/
│ └── bot.log # Application logs
├── main.py # Entry point
├── requirements.txt # Python dependencies
└── .env # Environment variables
Run the automated installer script:
python install.pyOr install manually:
pip install -r requirements.txtCreate/edit .env file:
DISCORD_TOKEN="your_discord_bot_token"
GEMINI_API_KEY="your_gemini_api_key"
GROQ_API="your_groq_api_key"
OPENROUTER_API_KEY="your_openrouter_api_key"
CHANNEL_ID="your_discord_channel_id"
ADMIN_USER_ID="your_discord_user_id"python main.py/model- Change AI model and provider/stats- View your usage statistics/help- Show help message
/reset- Reset your conversation history/user_reset- Reset a specific user's memory/kick- Kick a member from the server/ban- Ban a member from the server/unban- Unban a user/timeout- Timeout a member
Main bot settings including token limits, reset thresholds, and provider defaults.
Available AI models with metadata (ratings, speeds, capabilities).
System instruction templates for AI behavior.
This version includes fixes for:
- ✅ Duplicate code in providers.py
- ✅ Hardcoded admin user ID (now in .env)
- ✅ Error handling variable scope issues
- ✅ Race conditions in session management
- ✅ Missing command sync on startup
- ✅ Improved retry logic with proper variable access
- Modern color scheme with Discord Blurple theme
- Rich embeds with emojis and visual hierarchy
- Interactive model selection with dropdowns
- Styled error messages with helpful tips
- Loading indicators and status embeds
Private use project.
Created for Discord server automation and AI assistance.