What is GPTDiscord?
GPTDiscord is an open-source Python bot that puts OpenAI's models inside a Discord server. It sits in the Assistants & Chatbots category of the Agents & Automation tools and is open-source, written in Python and licensed MIT. To get started: clone the project.
Overview
GPTDiscord is an open-source Python bot that puts OpenAI's models inside a Discord server. You run it yourself with your own OpenAI API key and Discord bot token, and members reach it through grouped slash commands: /gpt converse opens a ChatGPT-style conversation in a thread or a whole channel, /gpt ask answers a one-off prompt, and you can simply tag the bot in chat for a reply. Conversations can include images the bot looks at, and it can draw with DALL-E inside the same exchange.

Beyond chat, the bot bundles several specialised modes. /code chat is a code-interpreter conversation that runs Python in an isolated execution environment (the project credits E2B for code execution), with the ability to install packages and reach the internet. /internet chat and /internet search connect the model to Google, Wolfram Alpha and a web crawler. The /index commands build custom indexes from uploaded files, links or Discord channel history, so the bot can answer from your own documents; the project is moving its vector storage from Pinecone to Qdrant.

Server-management features sit alongside the AI ones: automatic AI moderation with an alert channel, DeepL translation, role-based permissions for GPT, DALL-E and admin commands, per-user and per-channel system instructions, optional per-user API keys, token-usage tracking and a low-usage mode that switches to a cheaper model. Everything is configured through a single .env file, and the bot can be run directly with Python, in Docker, or with Docker Compose.
What it does
- ChatGPT-style conversations in threads or channels with /gpt converse, including image understanding and in-conversation DALL-E drawing
- Code interpreter mode (/code chat) that executes Python in an isolated environment and can install packages
- Internet-connected chat and search backed by Google, Wolfram Alpha and a link crawler
- Custom indexes for document Q&A from uploaded files, links or Discord channel history (/index add, /index chat, /index discord_backup)
- DALL-E image generation plus a prompt optimizer, and DeepL translation
- AI moderation, role-based command permissions, per-user and per-channel instructions, and optional user-supplied API keys
- Operational controls in Discord: model settings such as temperature and top_p, usage tracking, low-usage mode and a debug channel for raw responses
Getting started
You need an OpenAI API key and a Discord bot token (create an application in the Discord Developer Portal, enable its intents and invite it with the bot and applications.commands scopes). The project recommends Python 3.9.
Clone the project
git clone https://github.com/Kav-K/GPTDiscord.git
cd GPTDiscord/Install the dependencies
The torch and whisper packages power OCR/document features and audio extraction for indexing .mp3 and .mp4 files.
python3.9 -m venv venv
source venv/bin/activate
python3.9 -m pip install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
python3.9 -m pip install git+https://github.com/openai/whisper.git
python3.9 -m pip install -r requirements.txt
python3.9 -m pip install .Configure the .env file
Copy the sample and fill in at least OPENAI_TOKEN, DISCORD_TOKEN, DEBUG_GUILD, DEBUG_CHANNEL and ALLOWED_GUILDS. Guild and channel IDs come from right-clicking a server or channel in Discord and choosing Copy ID. Role lists such as ADMIN_ROLES, DALLE_ROLES and GPT_ROLES control who can use which commands.
cp sample.env .env
nano .envRun the bot
python3.9 gpt3discord.pyOr run it in Docker
Mount your .env file to /opt/gpt3discord/etc/environment and add DATA_DIR=/data and SHARE_DIR=/data/share to it. A docker-compose.yml is also provided: fill in .env and run docker-compose up -d.
docker run -d --name gpt3discord -v env_file:/opt/gpt3discord/etc/environment -v /containers/gpt3discord:/data -v /containers/gpt3discord/share:/data/share ghcr.io/kav-k/gptdiscord:main-fullCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a Discord community a shared ChatGPT-style assistant that runs on your own OpenAI key, with roles deciding who can use it
- Let members ask questions over uploaded documents, links or a server's own channel history
- Run Python analysis or web-connected research without leaving Discord
- Add automatic AI moderation and translation to a busy server
How GPTDiscord compares
GPTDiscord alongside other open-source assistants & chatbots tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| OpenClaw | ★ 395k | OpenClaw is a self-hosted personal AI assistant that answers you on WhatsApp, Telegram, Slack, Discord, and many other channels, with voice and a live visual canvas. |
| Hermes Agent | ★ 267k | A self-improving personal AI agent from Nous Research that builds skills from experience, remembers across sessions, and reaches you on Telegram, Discord, Slack, and more. |
| Odysseus | ★ 96.1k | A self-hosted AI workspace that puts chat, agents, deep research, documents, email, notes, tasks and calendar behind one Docker Compose stack, over local or API models. |
| CowAgent | ★ 48.2k | A self-hosted assistant that plans and executes tasks with built-in file, terminal, browser and search tools, and answers across a web console plus a dozen messaging platforms. |
| AstrBot | ★ 47.8k | An all-in-one agent chatbot platform that puts LLM conversations, tools, knowledge bases and a plugin marketplace inside messaging apps like Telegram, Slack, Discord, QQ and Feishu. |
| OpenHuman | ★ 43k | A local-first desktop personal AI for macOS, Windows and Linux that keeps a compressed memory tree on your machine and orchestrates checkpointed research and automation workflows. |
| MindsHub | ★ 39.9k | An agent workspace for knowledge work and software development that runs swappable open-source agent harnesses against your choice of frontier or open models. |
| GPTDiscord | ★ 1.9k | A self-hosted OpenAI bot for Discord — ChatGPT-style threads, image understanding, DALL-E, code execution, document Q&A and AI moderation behind slash commands |



