meerajGPT is a Discord bot to give everyone access to a QnA based large language model.
meerajGPT is written in Python that uses the OpenAI API to have QnA in a predefined discord channel with the gpt-3.5-turbo
model.
This bot uses the OpenAI Python Library and discord.py.
- Go to https://platform.openai.com/account/api-keys, create a new API key, and fill in
OPENAI_KEY
variable in responses.py or set it as environment variable. - Create your own Discord application at https://discord.com/developers/applications
- Go to the Bot tab and click "Add Bot"
- Click "Reset Token" and fill in
TOKEN
in bot.py - Disable "Public Bot" unless you want your bot to be visible to everyone
- Enable "Message Content Intent" under "Privileged Gateway Intents"
- Click "Reset Token" and fill in
- Copy the server name you want to allow your bot to be used in into
CHAT_CHANNEL
- Install dependencies and run the bot
Note: make sure you are using Python 3.9+ (check with python --version)
pip install -r requirements.txt python main.py
Why isn't my bot responding to commands?
Ensure that the channels your bots have access to allow the bot to have these permissions.
- Send Messages
- Send Messages in Threads
- Create Public Threads
- Manage Threads
- Read Message History
- Use Application Commands