From 3135ddddd6f6193f7979a3550e5ae5f6ddd0d2ad Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 21 Jul 2016 15:01:36 +0100 Subject: [PATCH] Create README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d8d824 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +trivia-bot +========== +A bot which provides a Trivia game for [Discord](https://discordapp.com/). + + +### 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](https://discordapp.com/oauth2/authorize?client_id=199657080083316737&scope=bot). +It requires no special permissions at this time (only read/write to channels). + + +### Trivia Questions +Questions are obtained from [trivia-db on Sourceforge](https://sourceforge.net/projects/triviadb/). + +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](http://www.boost.org/) | | +| websocketpp | [zaphoyd/websocketpp](https://github.com/zaphoyd/websocketpp) | Included as submodule. | +| cURL | [curl.haxx.se](https://curl.haxx.se/) | | +| sqlite3 | [sqlite.org](https://www.sqlite.org/) | Included as submodule. Uses a [different repo](https://github.com/azadkuh/sqlite-amalgamation/). | +| nlohmann/json | [nlohmann/json](https://github.com/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}`