![]() |
A powerful Discord bot integrating AI models to respond intelligently to user messages in real-time.
- Discord Integration: Seamless integration with Discord using discord.py
- Multi-Model Support: Support for multiple AI models via LiteLLM
- Multiple Providers: Configure different API providers (e.g., Gratisfy) with ease
- Async Processing: Non-blocking message processing using asyncio
- Comprehensive Logging: Detailed logging for debugging and monitoring
- Thread-Safe: Prevents multiple concurrent requests from the same user
- Dynamic Model Selection: Automatically selects the best model based on capabilities
- Persistent Memory: Conversation history stays in a local CocoIndex-backed SQLite store
- Transparent Deletion: Use
/memory list,/memory delete, and/memory clearto inspect or purge stored turns
- Python 3.8+
- Discord Bot Token
- API credentials for your chosen AI provider
-
Clone the repository
git clone https://github.com/YoannDev90/EvilGPT.git cd EvilGPT -
Create a virtual environment (recommended)
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
- Create a
.envfile in the root directory:
BOT_TOKEN=
WEBHOOK_URL=
AICHIXIA_API_KEY=
AIHUBMIX_API_KEY=
AQUA_API_KEY=
BLAZE_API_KEY=
ELECTRONHUB_API_KEY=
EVOLVEX_API_KEY=
HAPUPPY_API_KEY=
LOGFLARE_API_KEY=
MEGANOVA_API_KEY=
MISTRAL_API_KEY=
MNN_API_KEY=
NAVY_API_KEY=
NEXUSIFY_API_KEY=
NVIDIA_NIM_API_KEY=
PAXSENIX_API_KEY=
SECRETS_API_KEY=
TOKEN_REPLY_API_KEY=
ZANITY_API_KEY=-
Configure providers (optional)
- Edit
providers.jsonto add or modify API providers - Edit
models.jsonto configure available AI models
- Edit
-
Set up your Discord bot
- Create a bot on Discord Developer Portal
- Enable the "Message Content Intent" for the bot to read messages
- Copy the bot token to your
.envfile
python main.pyThe bot will start and log in to Discord. You'll see a confirmation message like:
Logged in as BotName (ID: 123456789)
Below is current snapshot of repository. This section is auto-updated by ./lint.sh on demand.
.
βββ assets
βΒ Β βββ fonts
βΒ Β βΒ Β βββ NotoSans-BoldItalic.ttf
βΒ Β βΒ Β βββ NotoSans-Bold.ttf
βΒ Β βΒ Β βββ NotoSans-Italic.ttf
βΒ Β βΒ Β βββ NotoSans-Regular.ttf
βΒ Β βββ images
βΒ Β βββ evilgpt.png
βΒ Β βββ evilgpt.svg
βββ bot.py
βββ cmds
βΒ Β βββ health.py
βΒ Β βββ __init__.py
βΒ Β βββ list_tools.py
βΒ Β βββ loader.py
βΒ Β βββ memory_clear.py
βΒ Β βββ memory_delete.py
βΒ Β βββ memory_list.py
βΒ Β βββ ping.py
βΒ Β βββ set_mood.py
βΒ Β βββ _shared.py
βββ config.toml
βββ core
βΒ Β βββ config.py
βΒ Β βββ model.py
βΒ Β βββ models_loader.py
βΒ Β βββ tools.py
βββ data
βΒ Β βββ cocoindex_memory.db
βΒ Β βΒ Β βββ mdb
βΒ Β βΒ Β βββ data.mdb
βΒ Β βΒ Β βββ lock.mdb
βΒ Β βββ command_sync_state.json
βΒ Β βββ mcp.json
βΒ Β βββ memory.sqlite
βΒ Β βββ memory_state.json
βΒ Β βββ models.json
βΒ Β βββ moods
βΒ Β βΒ Β βββ aggressive.txt
βΒ Β βΒ Β βββ jester.txt
βΒ Β βΒ Β βββ mastermind.txt
βΒ Β βΒ Β βββ neutral.txt
βΒ Β βΒ Β βββ nihilist.txt
βΒ Β βΒ Β βββ sarcastic.txt
βΒ Β βββ providers.json
βΒ Β βββ tools
βΒ Β βββ image_ocr.json
βΒ Β βββ run_bash.json
βΒ Β βββ run_nodejs.json
βΒ Β βββ run_python.json
βΒ Β βββ safe_eval_math.json
βΒ Β βββ sandbox_create.json
βΒ Β βββ sandbox_exec.json
βΒ Β βββ sandbox_fs_list.json
βΒ Β βββ sandbox_fs_mkdir.json
βΒ Β βββ sandbox_fs_read.json
βΒ Β βββ sandbox_fs_remove.json
βΒ Β βββ sandbox_fs_stat.json
βΒ Β βββ sandbox_fs_write.json
βΒ Β βββ sandbox_inspect.json
βΒ Β βββ sandbox_list.json
βΒ Β βββ sandbox_metrics.json
βΒ Β βββ sandbox_remove.json
βΒ Β βββ sandbox_run.json
βΒ Β βββ sandbox_shell.json
βΒ Β βββ sandbox_stop.json
βββ .github
βΒ Β βββ workflows
βΒ Β βββ pre-commit.yml
βββ .gitignore
βββ LICENSE
βββ lint.sh
βββ main.py
βββ managers
βΒ Β βββ context.py
βΒ Β βββ mcp.py
βΒ Β βββ memory.py
βΒ Β βββ tools
βΒ Β βββ image_ocr.py
βΒ Β βββ __init__.py
βΒ Β βββ run_bash.py
βΒ Β βββ run_nodejs.py
βΒ Β βββ run_python.py
βΒ Β βββ safe_eval_math.py
βΒ Β βββ sandbox_create.py
βΒ Β βββ sandbox_exec.py
βΒ Β βββ sandbox_fs_list.py
βΒ Β βββ sandbox_fs_mkdir.py
βΒ Β βββ sandbox_fs_read.py
βΒ Β βββ sandbox_fs_remove.py
βΒ Β βββ sandbox_fs_stat.py
βΒ Β βββ sandbox_fs_write.py
βΒ Β βββ sandbox_inspect.py
βΒ Β βββ sandbox_list.py
βΒ Β βββ sandbox_metrics.py
βΒ Β βββ sandbox_remove.py
βΒ Β βββ sandbox_run.py
βΒ Β βββ sandbox_shell.py
βΒ Β βββ sandbox_stop.py
βββ README.md
βββ requirements.txt
βββ utils
βββ handlers
βΒ Β βββ codeblock.py
βΒ Β βββ latex.py
βΒ Β βββ messages.py
βΒ Β βββ table.py
βββ logger.py
17 directories, 92 files
Shell: 1 files, 167 lines of code
JSON: 25 files, 402 lines of code
Markdown: 1 files, 279 lines of code
Python: 45 files, 3674 lines of code
SVG: 1 files, 17 lines of code
TOML: 1 files, 13 lines of code
Text: 7 files, 177 lines of code
Total: 81 files, 4729 lines of code, 1937 comments, 1154 blank lines
Run ./lint.sh to format code and regenerate this project tree snapshot. CI runs the same script on every push/PR.
The bot automatically selects the most appropriate model based on:
- Required input/output formats
- API parameters support
- Model availability
- Message received from Discord user
- Bot checks if user is already processing a request (prevents spam)
- Message payload is constructed
- AI model generates response in a thread pool (non-blocking)
- Response is sent back to Discord
- Text-to-text AI generation
- Configurable API endpoints
- Fallback model selection
- Token counting and usage tracking
- Performance timing
- Persistent conversation memory with per-turn deletion
- `discord.py==2.7.1` - A Python wrapper for the Discord API (latest: 2.7.1)
- `python-dotenv==1.2.2` - Read key-value pairs from a .env file and set them as environment variables (latest: 1.2.2)
- `litellm==1.84.0` - Library to easily interface with LLM API providers (latest: 1.85.0)
- `requests==2.34.2` - Python HTTP for Humans. (latest: 2.34.2)
- `colorama==0.4.6` - Cross-platform colored terminal text. (latest: 0.4.6)
- `cairosvg==2.9.0` - A Simple SVG Converter based on Cairo (latest: 2.9.0)
- `Pillow==12.2.0` - Python Imaging Library (fork) (latest: 12.2.0)
- `pilmoji==2.0.5` - Pilmoji is an emoji renderer for Pillow, Python's imaging library. (latest: 2.0.5)
- `microsandbox==0.4.6` - Python SDK for microsandbox β secure, fast microVM-based sandboxing. (latest: 0.4.6)
- `aiohttp==3.13.5` - Async http client/server framework (asyncio) (latest: 3.13.5)
- `discord-webhook==1.4.1` - Easily send Discord webhooks with Python (latest: 1.4.1)
- `cocoindex==1.0.5` - With CocoIndex, users declare the transformation, CocoIndex creates & maintains an index, and keeps the derived index up to date based on source update, with minimal computation and changes. (latest: 1.0.6)
- `fastmcp==3.3.0` - The fast, Pythonic way to build MCP servers and clients. (latest: 3.3.1)
- `pytesseract==0.3.13` - Python-tesseract is a python wrapper for Google's Tesseract-OCR (latest: 0.3.13)
- `pint==0.25.3` - Physical quantities module (latest: 0.25.3)- Project provides
lint.shat repo root. - Run locally before commit:
./lint.sh- CI: GitHub Actions workflow runs
lint.shonpushandpull_requesttomasterand feature branches. Fix issues locally and push again.
- Add provider configuration to
providers.json - Set up environment variable for API key
- Update
config.pyif needed
- Configure the model in
models.json - Ensure the provider has the necessary API credentials
- The bot ignores messages from other bots and direct messages
- Users cannot send multiple concurrent requests (prevents API overload)
- Message content intent must be enabled for the bot to work
- API keys and tokens should never be committed to version control
- Local memory state lives under
data/memory_state.jsonand syncs into a local SQLite store through CocoIndex
This project is provided as-is. Please respect Discord's Terms of Service and API usage policies.
Feel free to submit issues and enhancement requests!
Made with β€οΈ for Discord automation
