A bot which provides a Trivia game for Discord
Go to file
jackb-p 69f7452f04 Reduce required CMake version
Unsure of the actual minimum required version
2016-07-31 21:04:18 +01:00
lib Re-add mistakenly removed submodules 2016-07-31 20:45:09 +01:00
TriviaBot Reduce required CMake version 2016-07-31 21:04:18 +01:00
.gitattributes Add .gitignore and .gitattributes. 2016-06-20 16:02:37 +01:00
.gitignore Re-add mistakenly removed submodules 2016-07-31 20:45:09 +01:00
.gitmodules Re-add mistakenly removed submodules 2016-07-31 20:45:09 +01:00
.travis.yml Travis: Further fixes 2016-07-31 21:00:11 +01:00
README.md Update README.md 2016-07-21 16:02:33 +01:00

#trivia-bot

A bot which provides a Trivia game for Discord.

Adding to a server

You can either self-host trivia-bot, or use the hosted version.

To invite the bot to your server use this invite link. It requires no special permissions at this time (only read/write to channels).

Trivia Questions

Questions are obtained from trivia-db on Sourceforge.

To parse the .txt question files, place them in /data_management/questions/ then run LoadDB.cpp. You need to create the database first. Use the included schema and create the database as /bot/db/trivia.db.

LoadDB.cpp takes some time to execute.

Commands

`trivia is the base command.

Argument Description
questions interval Where questions and interval are integers. Makes the game last questions number of questions, optionally sets the time interval between hints to interval seconds.
stop Stops the trivia game currently in the channel the message is sent from, if there is one.
help Prints a help list, similar to this table.

Compiling

Dependencies

Name Website Notes
boost boost.org
websocketpp zaphoyd/websocketpp Included as submodule.
cURL curl.haxx.se
sqlite3 sqlite.org Included as submodule. Uses a different repo.
nlohmann/json nlohmann/json (Slightly modified) source file included in repo.

Linux (debian)

  1. Clone the github repo: git clone https://github.com/jackb-p/TriviaDiscord.git TriviaDiscord
  2. Navigate to repository directory: cd TriviaDiscord
  3. Clone the submodules: git submodule init and git submodule update
  4. Install other dependencies: sudo apt-get install cmake libboost-all-dev libcurl-dev
  5. cd TriviaBot
  6. cmake .
  7. make

Running

To run simply execute the program: ./TriviaBot

If you do not want to be prompted for your token every launch, provide it as an argument: ./TriviaBot {TOKEN}