Skip to content

Bot Discord Java integrated with the OpenAi API, it receives a prompt from the user passed as parameter in slash command, makes the request and returns the response from the API.

Notifications You must be signed in to change notification settings

giovaneneves7/Java-Discord-Bot-integrated-with-OpenAi-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What does this code do?

  • 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?":

image

Important Notes:

  • You will need an OpenAi API Key, it can be obtained from the official OpenAi website: openai.com

image

  • You will need your bot's token.

image

  • You can change the chatbot model in the "OpenAiRequest" Class.

image

  • You can edit the maximum amount of tokens, respecting the limit already set by Discord

image

About

Bot Discord Java integrated with the OpenAi API, it receives a prompt from the user passed as parameter in slash command, makes the request and returns the response from the API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages