Davinci Bot is an easily configurable OpenAI Powered Discord Bot
- Install nodejs 16+
- Install yarn with
npm install -g yarn
- Install packages with
yarn
- Copy
.env.example
to.env.local
and populate the values to configure (or use as a template for environment variables on your server) - Build with
yarn build
and start withyarn start
(or useyarn dev
to do both in one step!)
Configuration is done within the .env.local
file you created above. Here are details for each option:
Set up your Discord bot in the Discord Developer Portal (More info). Paste the token you receive in this process into this variable. Note: Your bot will need to have the "Message Content Intent" turned on in order to read and respond to messages.
Create an OpenAI account for API access and then create a secret key. Paste this into this variable.
These are comma-seperated messages which if the Discord bot notices an exact match (case insensitive), it will automatically respond to without being directly mentioned or replied to. Defaults to none (blank string)
Set the name of the model you wish to use. Can put any model your API key can access, including trained/fine tuned models. Defaults to text-davinci-003
(the current latest & greatest) if no value is set.
Describe how you want your bot to behave. Defaults to friendly, helpful and professional
if no value is set.
Name of your bot. If someone asks "what is your name" this is how it will respond, basically. Defaults to Davinci
if no value is set.
Temperature of the bot. More info here. Defaults to 0.8
if no value is set.
Max tokens of the bot reponse. More info here. Defaults to 1000
if no value is set.
Delay response when one is triggered. This is more useful if you want to have multiple instances of the bot talking to each other (so they don't spam)
ID of the Discord user to respond delay to. If not included, will delay response to all users if RESPOND_DELAY
is set
If set to true
, the node application will not log to the terminal.