Once per day, the bot sends a random question from Open Trivia Database to the first text channel in the server, at a random time between 10AM and 11PM AEST.
Users get one attempt at answering the question; if they answer correctly, they are given some points and their streak is incremented by one. If they answer incorrectly, their points and streak is reset.
The first user to answer correctly gets 3 points, the second gets 2 points and the third gets 1 point. After three people have answered correctly (or half an hour passes), the question is closed.
(Don't mind the name of my bot 😅)
- Make sure you have Node and Docker installed
- Create an application through the Discord developer portal and get yourself a token
- Add this application (the bot) to your server. You need to make sure it has the following permissions
View Channels
,Send Messages
,Embed Links
andRead Message History
- Add this application (the bot) to your server. You need to make sure it has the following permissions
- Run
docker-compose up
- This will spin up
postgres
andpgAdmin
containers postgres
is the databasepgAdmin
is a GUI for querying the database (when adding a server, the container name is the host!)
- This will spin up
- Create an
.env
file based off.env.example
and fill out the values - Install the depenencies with your package manager of choice
- Run the
start
script!
- Node.js
- Discord.js
- Postgres