A Python based Discord chat bot that uses the OpenAI GPT API with a custom role
OpenAI GPT3.5 model allow to change it behavior using custom training and using system role messages, this repository allows to create a Discord Bot using the GPT 3.5 model with a custom role allowing to change the behavior of the answers of the bot.
- You must a have a valid OpenAI API key to use it services (Currently using GPT-3.5-turbo).
- You need a valid Discord bot Token.
- A Python environment to run the repo.
- If you want to use voice related commands you need FFmpeg on the device that will run the bot
Full setup guide available at Setup guide
-
Install Python 3.9 in your device.
-
Clone the repository:
git clone https://github.com/02loveslollipop/DiscordGPTChatBot.git
-
Install FFmpeg on your device, FFmpeg can be install here
-
Create a copy of
example_config.yml
and rename it asconfig.yml
, then open it and paste your Discord and OpenAI keys and change the role of the chat bot (Full description of config.yml):
bot:
token: "YOUR_DISCORD_KEY" # Paste here the token you got from Discord Developer Portal
open_ai:
token: "YOUR_OPEN_AI_KEY" # Paste here the OpenAI secret key you got from OpenAI platform
role: "You are a helpful assistant." # Change here chatbot's role, this will change it's behavior answering questions
- Install requirements:
pip -r /path/to/your/repo/requirements.txt
- Run the bot:
python main.py