Discord bot for OpenAI chat completions
Top 24.1% on sourcepulse
This project provides an example Discord bot written in Python that leverages OpenAI's chat completions API for conversational AI and the moderations API for message filtering. It's designed for developers and Discord server administrators looking to integrate advanced AI chat capabilities into their communities, offering features like threaded conversations and customizable bot instructions.
How It Works
The bot utilizes the discord.py
library to interact with Discord and the OpenAI Python Library to communicate with OpenAI's models. It supports starting public threads with a /chat
command, passing the entire thread history to the model for context-aware responses. Moderation is handled by the OpenAI Moderations API, with configurable thresholds to filter messages.
Quick Start & Requirements
pip install -r requirements.txt
python -m src.main
.env
file).Highlighted Details
gpt-3.5-turbo
model by default.config.yaml
.src/constants.py
.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
1 year ago
1 week