The ChatGPT Discord Bot is a versatile chatbot that allows you to have conversations with the GPT-3.5 (or GPT-4 when available) model by OpenAI within Discord threads. It supports a range of features, including predefined personalities (such as JakePy, a Python expert), and the ability to generate images using DALL-E.
Update GPT-4 is available, GPT-4-turbo-preview too
To run this bot, ensure you have Python 3.11 installed on your system. Follow the steps below to set up a virtual environment (venv) and install the required dependencies:
- Clone the bot's GitHub repository using the following command:
git clone https://github.com/AlexTraveylan/gpt4-discord-bot
- Navigate to the project directory:
cd gpt4-discord-bot
- Create a virtual environment using Python 3.11:
python -m venv venv
- Activate the virtual environment:
- On Linux/macOS:
source venv/bin/activate
- On Windows (PowerShell):
.\venv\Scripts\Activate
- On Linux/macOS:
- Install the required dependencies from the requirements.txt file:
pip install -r requirements.txt
To ensure the bot works correctly, create a .env file at the project's root directory and provide the following information:
PYTHONPATH=.
OPENAI_API_KEY="Your OpenAI token to use the OpenAI API"
DISCORD_BOT_TOKEN="Your Discord bot token"
DISCORD_CLIENT_ID="Your Discord user ID"
ADMIN_SECRET=needed for task, you maybe should delete the feature
MAIN_CHANNEL_ID="Your main channel ID"
Make sure to obtain your OpenAI token by signing up on their website and creating an API key. For the Discord bot token, you'll need to create an application on the Discord Developer Portal and generate a bot token under the "Bot" tab. Your Discord user ID can be obtained by enabling Developer Mode in Discord and copying your own user ID.
Key features of the ChatGPT Discord Bot include:
- Real-time conversation with the GPT-3.5 (or GPT-4 or GPT-4-turbo-preview) model.
- Support for predefined personalities with preconfigured prompts, such as JakePy, a Python expert who can assist with pytest.
- The ability to generate images using DALL-E (upcoming feature).
Feel free to contribute to the bot's development or open issues to report bugs or suggest improvements.
Enjoy engaging in conversations with the ChatGPT Discord Bot! 🤖✨
This project is licensed under the MIT License.
Contributions are welcome! Please add a pull request for help.