- Clone this repository:
git clone https://github.com/yeralin/DiscordGPT.git
- Install the required dependencies (required python version >3.7):
pip install -r requirements.txt
- Get OpenAI API key (
OPENAI_API_KEY
) and a Discord bot token (DISCORD_TOKEN
) - Create a .env file in the root directory of the project and add the following:
OPENAI_API_KEY=<your-openai-api-key>
DISCORD_TOKEN=<your-discord-bot-token>
Make sure to replace and with your actual API key and token.
To start the bot, run: python bot.py
Once the bot is running, you can interact with it by sending messages to it on Discord.
- Go to the OpenAI website (https://openai.com/) and click on the "Get started for free" button.
- Create an account by filling out the registration form.
- Once you've created an account, you'll need to add a payment method to your account to get access to the API.
- Once you have added a payment method, go to the "API Keys" tab in your OpenAI account dashboard.
- Click on the "Create API Key" button and give your key a name.
- Copy the API key that is generated and store it somewhere safe.
- Store the API key under
.env
file asOPENAI_API_KEY=<your-openai-api-key>
OpenAI offers a free trial with $200 in credits, so you won't be charged if you stay within that limit.
- Go to the Discord Developer Portal.
- Click the "New Application" button, and give your application a name.
- Click on your application and go to the "Bot" tab in the left sidebar.
- Click the "Add Bot" button to create a bot account for your application.
- Scroll down to the "Token" section and click the "Copy" button to copy your bot token to the clipboard.
- Save the token in a secure location and never share it with anyone.
This project is licensed under the MIT License - see the LICENSE file for details.