- This code makes a connection between a Discord bot and the ChatGPT API, where the response to the prompt entered by the user is returned, as in the example below. The prompt typed in was "What is GitHub?":
- You will need an OpenAi API Key, it can be obtained from the official OpenAi website: openai.com
- You will need your bot's token.
- You can change the chatbot model in the "OpenAiRequest" Class.
- You can edit the maximum amount of tokens, respecting the limit already set by Discord