← all repositories
openai/gpt-discord-bot

OpenAI’s Discord bot example that refuses feature PRs

It is the official starter template for adding threaded, moderated GPT conversations to a Discord server.

1.8k stars Python Chat Assistants
gpt-discord-bot
Not currently ranked — collecting fresh signals.
star history

What it does

This is a reference Python bot that drops OpenAI’s chat completions API into Discord via discord.py. Users invoke a /chat command to spawn a public thread, and the bot—defaulting to gpt-3.5-turbo—replies to every subsequent message while feeding the entire thread history back to the model for context. It also runs messages through OpenAI’s moderations API and can auto-close threads when they hit token or message limits.

The interesting bit

The entire thread history is passed back to the model on every request, giving the bot a memory of the conversation until a hard limit forces the thread to close. It is a simple but effective pattern that avoids complex state management. The moderation hook is similarly pragmatic, silently routing flagged content to a configured channel instead of crashing the conversation.

Key highlights

  • Spawns public Discord threads via /chat and maintains full conversation context until limits are hit.
  • Built-in moderation pipeline using OpenAI’s moderations API with configurable thresholds.
  • Personality and instructions are adjustable through config.yaml without touching the core logic.
  • Ships as a minimal, readable example rather than an opinionated framework.

Caveats

  • The maintainers only accept bug-fix PRs and direct all feature work to forks, so do not expect upstream evolution.
  • Needs a broad set of Discord permissions—thread creation, message history, and moderation deletion—to do anything at all.
  • The repo description cites text-davinci-003, while the README points to gpt-3.5-turbo, so the documented target model is inconsistent.

Verdict

Grab this if you want a minimal, working reference for integrating OpenAI into Discord threads without building from scratch. Skip it if you are looking for a batteries-included, extensible bot framework; the maintainers will tell you to fork it and figure that out yourself.

Frequently asked

What is openai/gpt-discord-bot?
It is the official starter template for adding threaded, moderated GPT conversations to a Discord server.
Is gpt-discord-bot open source?
Yes — openai/gpt-discord-bot is open source, released under the MIT license.
What language is gpt-discord-bot written in?
openai/gpt-discord-bot is primarily written in Python.
How popular is gpt-discord-bot?
openai/gpt-discord-bot has 1.8k stars on GitHub.
Where can I find gpt-discord-bot?
openai/gpt-discord-bot is on GitHub at https://github.com/openai/gpt-discord-bot.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.