Discord OpenAi roleplay chatbot. Harvests AI and username/character intelligence.
Commands are:
!start
!stop
!reset
!rp (text)
!botname (name of character you want to rp with, default is "AI")
!username (your character, default is "Human")
Set these variables in the python file:
#OpenAI API key
openai.api_key = "OPENAI KEY"
#Discord key
dkey = 'DISCORD KEY'
-
To obtain the openai API key, visit their website and register for one: https://beta.openai.com/
-
Click join the waitlist, and wait for a email (this can take a LONG time, like months.)
-
Put the key into the API key spot for OpenAI in the python file from the API settings on the OpenAI webpage once you get an account.
-
On discord developers page here: https://discord.com/developers/applications
-
Create a new application, give it a name such as "RP-Bot" Set a avatar if you wish. Set a description and save changes.
-
Click bot and click add bot.
-
Hit yes, then copy the token and put it in the python file replacing "DISCORD KEY"
-
Open the Oauth tab. Checkmark "Bot" then below that check "Read message history" and "Send Messages."
-
Copy the link to add the bot to your server after running the python file, make sure to install requirements with pip.
Note: There is a sentiment analysis to check for negative inputs/outputs in the code. It is currently set about in the middle.