diff options
author | Benji Dial <benji@benjidial.net> | 2024-05-06 16:13:43 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-05-06 16:13:43 -0400 |
commit | 5224e17a9ef3bbd6c9c3196d841e2acc66a52321 (patch) | |
tree | e07cbbd21959856b5cbe71a8678058e5b1dddc9d /readme.txt | |
parent | 85a94138c89c8389f9828f097b3e96f8b94ed5d6 (diff) | |
download | bracket-bot-5224e17a9ef3bbd6c9c3196d841e2acc66a52321.tar.gz |
write readme, add license
Diffstat (limited to 'readme.txt')
-rw-r--r-- | readme.txt | 46 |
1 files changed, 45 insertions, 1 deletions
@@ -1 +1,45 @@ -to do: write readme. +=== bracket bot === + +before you begin, you will need the following: +* a discord bot token + (see e.g. https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token) +* the channel id of the channel where the polls should be posted + (see https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID) +* a list of entries for your bracket + +to build the bracket bot, just run make. the bracket bot uses libcurl, +libsqlite3, and Niels Lohmann's json library. the json library is downloaded +at build time. the required packages to build on debian are the following: +* g++ +* libcurl-dev (this is a virtual package, satisfiable by a few options) +* libsqlite3-dev +* make +* wget + +when the bot is run, it expects the following environment variables: +* BOT_TOKEN: the bot token +* CHANNEL_ID: the channel id +* POLLS_PER_DAY: the number of polls to post each day +* POST_TIME_UTC: the number of seconds past midnight utc to post the polls + (for example, to post at midnight eastern daylight time, set this to 14400) +and it expects to find a list of entries, separated by newlines, in a file +named entries.txt in the directory where it is run. + +the bot creates a sqlite3 database in database.db, with the following tables: +* misc: this contains one column and one row with the current round number +* entries: a list of every entry + * name: the name of the entry + * round: if the entry has been eliminated, a zero. if the entry has passed + the current round, then the number of the next round. if the entry has not + appeared in a poll this round, or is in an active poll, then the number of + the current round. + * in_active_poll: if the entry is in an active poll, a one, otherwise a zero +* active_polls: a list of the message ids for the active polls +* past_polls: a list of every concluded poll + * round: the round where this poll happened + * entry_1: the name of the first entry + * entry_2: the name of the second entry + * users_1: the user ids of the users who voted + for the first entry, separated by commas + * users_2: the user ids of the users who voted + for the second entry, separated by commas |