A clean, efficient Discord bot that provides AI-powered responses using OpenRouter's API. The bot responds to mentions and direct messages with natural language processing capabilities.
- Numan Khan (@Nuu-maan)
- GitHub: https://github.com/Nuu-maan
- 🤖 AI-powered responses using OpenRouter's API
- 💬 Natural conversation through mentions and DMs
- 🎨 Clean, minimal embed-based responses
- ⚡ Fast and efficient response handling
- 🔒 Secure configuration using environment variables
- Python 3.8+
- discord.py - Modern Discord API wrapper
- OpenRouter API - AI model access
- python-dotenv - Environment variable management
- aiohttp - Async HTTP client
- Clone this repository:
git clone https://github.com/Nuu-maan/Discord-AI-Assistant.git
cd Discord-AI-Assistant- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory:
DISCORD_TOKEN=your_discord_bot_token
OPENROUTER_API_KEY=your_openrouter_api_key
-
Get your API keys:
- Discord Bot Token: Discord Developer Portal
- OpenRouter API Key: OpenRouter
-
Run the bot:
python bot.pySimply mention the bot or send it a direct message to start a conversation:
@AI Assistant What's the weather like?
The bot will respond with a clean, embed-formatted message.
discord-chatter/
├── bot.py # Main bot file
├── utils/
│ └── ai_utils.py # AI API interactions
├── .env # Environment variables
├── .gitignore # Git ignore file
├── README.md # Documentation
└── requirements.txt # Dependencies
- Clean, modular code structure
- Type hints for better code maintainability
- Comprehensive error handling
- Async/await for efficient performance
- Professional embed formatting
- Secure API key management
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Numan Khan
- discord.py - Discord API wrapper
- OpenRouter - AI model access