Skip to content

YoannDev90/EvilGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EvilGPT πŸ€–

EvilGPT Icon Python License

A powerful Discord bot integrating AI models to respond intelligently to user messages in real-time.

Table of contents

✨ Features

  • 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 clear to inspect or purge stored turns

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Discord Bot Token
  • API credentials for your chosen AI provider

Installation

  1. Clone the repository

    git clone https://github.com/YoannDev90/EvilGPT.git
    cd EvilGPT
  2. Create a virtual environment (recommended)

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt

Configuration

  1. Create a .env file 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=
  1. Configure providers (optional)

    • Edit providers.json to add or modify API providers
    • Edit models.json to configure available AI models
  2. 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 .env file

Running the Bot

python main.py

The bot will start and log in to Discord. You'll see a confirmation message like:

Logged in as BotName (ID: 123456789)

πŸ“ Project Structure

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

Code Statistics

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.

πŸ”§ Technical Details

AI Model Selection

The bot automatically selects the most appropriate model based on:

  • Required input/output formats
  • API parameters support
  • Model availability

Message Processing

  1. Message received from Discord user
  2. Bot checks if user is already processing a request (prevents spam)
  3. Message payload is constructed
  4. AI model generates response in a thread pool (non-blocking)
  5. Response is sent back to Discord

Supported Features

  • 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

πŸ“¦ Dependencies

- `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)

πŸ› οΈ Development

Linting & CI

  • Project provides lint.sh at repo root.
  • Run locally before commit:
./lint.sh
  • CI: GitHub Actions workflow runs lint.sh on push and pull_request to master and feature branches. Fix issues locally and push again.

Adding New Providers

  1. Add provider configuration to providers.json
  2. Set up environment variable for API key
  3. Update config.py if needed

Adding New Models

  1. Configure the model in models.json
  2. Ensure the provider has the necessary API credentials

⚠️ Important Notes

  • 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.json and syncs into a local SQLite store through CocoIndex

πŸ“ License

This project is provided as-is. Please respect Discord's Terms of Service and API usage policies.

🀝 Contributing

Feel free to submit issues and enhancement requests!


Made with ❀️ for Discord automation

About

A very malicious Discord bot, perfect for the darkest of questions. No censorship, a rotten nature, and a sadistic, evil personality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors