A discord chat bot integrated with OpenAI.
Before starting you need Discord Bot Token and OpenAI API Key. All of the Privileged Gateway Intents also need to be enabled in you discord bot.
For manual installation you'll need Node.js 16 or above and a MongoDB server for storing chat messages which later be used to generate conversation responses from OpenAI. If you don't want to host MongoDB yourself you can try getting it from mongodb.com for free.
- Rename
.env.example
to.env
- Fill up the cofiguration in the .env file
- Install the dependencies with
npm install
- Start the bot with
npm run start
ornpm run dev
for development
Make sure you have docker installed on you machine, you can refer to https://docs.docker.com/get-docker/ for the installation
- Rename
.env.example
to.env
- Fill up the cofiguration in the
.env
(don't change theDB_HOST
as it is provided by docker, you can leaveDB_USER
andDB_PASSWORD
empty) - Start the container
docker compose up
or start the container in detached mode so you don't need to leave command promt openeddocker compose up -d
- Force rebuild the bot, for when you make some changes to the source code
docker compose up --build
- Stop the container
docker-compose down