A simple Discord Bot in Python interacting with ChatGPT API
Modify the config.json with the following instruction.
Visit OpenAI keys settings and follow the steps to create your API key. Remember to save your keys.
Next add your organization id.
Login to Discord through the web browser.
Open “Developer Tools” and look in the Networks tab.
Reload the page and look through the requests.
Filter by /api
In the headers look for Authorization. That is your token. Do not share it.
To get a Channel ID right click the channel and click on "Copy Link". The id is the last number after ../channels/
Refere to this documentation on which model is best for you. Default in the configuration is set to text-davinci-003.
pip3 install -r requirements.txt python3 main.py
In the discord channel type /chatgpt to ask ChatGPT questions.