rs-pugbot
is a Discord bot built to administer custom matches in
gaming, and provide a ranked ladder for the Discord's members to compete on.
These are covered in detail in MILESTONES.md
.
- Make sure you're running Rust's
stable
toolchain. This can be installed viarustup
:
$ rustup toolchain install stable
-
You will need a database server up and running. I recommend PostgreSQL, and all documentation is written assuming PostgreSQL.
- (Postgres) You will need to add a role for the
pugbot
user. What I did was this:
CREATE ROLE pugbot SUPERUSER LOGIN PASSWORD 'password';
- (Postgres) You will need to add a role for the
-
Install
diesel_cli
. See here for more information, but the below should get you going:
cargo install diesel_cli --no-default-features --features postgres
- You will also need a
.env
file. At the time of this writing (May '21), three key-value pairs are read from this file:TEAM_COUNT
: How many teams there are in a given gameTEAM_SIZE
: How many players are on each teamDATABASE_URL
: Connection string to the database, ex.postgres://pugbot:password@localhost:5432/pugbot
DISCORD_TOKEN
: An OAuth2 token issued by Discord that the bot will use to connect to your server.
- You'll need an OAuth2 token for your bot from Discord. While there are official documentation, I found this blog post more to-the-point.
I have found that, on Linux Mint (and Ubuntu etc. probably) you'll need to install the following:
- libssl-dev
- libpq5
- libpq-dev
- gcc-multilib
sudo apt install -y postgresql libssl-dev libpq5 libpq-dev gcc-multilib
First, you'll need Rust's stable toolchain, installed via rustup
:
$ rustup toolchain install stable
Then, you will need a .env
file with DATABASE_URL
and TEAM_COUNT
attributes. Rename the file rename-this-to-.env
to .env
. (.env
is in .gitignore
so it won't be added to version control.)
Finally, run cargo test
.
Contributions from all skill levels welcome! I'm learning Rust as I go here so I welcome contributions from fellow newbs and salty experts alike. Please see the GitHub issues for open tasks.
Licensed under MIT license (LICENSE or https://opensource.org/licenses/MIT)