.sqlx | ||
assets | ||
conf | ||
debian | ||
extract_derive | ||
migrations | ||
nginx | ||
private | ||
recordable_derive | ||
reminder-dashboard | ||
src | ||
static | ||
systemd | ||
templates | ||
.gitignore | ||
.prettierrc.toml | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
compose.yaml | ||
Containerfile.build | ||
Containerfile.run | ||
dp.py | ||
LICENSE | ||
README.md | ||
Rocket.toml | ||
rustfmt.toml |
reminder-rs
Reminder Bot for Discord.
How do I use it?
I offer a hosted version of the bot. You can invite it with: https://invite.reminder-bot.com. The catch is that repeating reminders are paid on the hosted version of the bot. Keep reading if you want to host it yourself.
You'll need rustc and cargo for compilation. To run, you'll need Python 3 still (due to no suitable replacement for dateparser in Rust)
Build APT package
Recommended method.
By default, this builds targeting Ubuntu 20.04. Modify the Containerfile if you wish to target a different platform. These instructions are written using podman
, but docker
should work too.
- Install container software:
sudo apt install podman
. - Install database server:
sudo apt install mysql-server-8.0
. Create a database calledreminders
- Install SQLx CLI:
cargo install sqlx-cli
- From the source code directory, execute
sqlx migrate run
- Build container image:
podman build -t reminder-rs .
- Build with podman:
podman run --rm --network=host -v "$PWD":/mnt -w /mnt -e "DATABASE_URL=mysql://user@localhost/reminders" reminder-rs cargo deb
Compiling for other target
- Install requirements:
sudo apt install gcc gcc-multilib cmake libssl-dev build-essential python3-dateparser
- Install rustup from https://rustup.rs
- Install the nightly toolchain:
rustup toolchain default nightly
- Install database server:
sudo apt install mysql-server-8.0
. Create a database calledreminders
. - Install
sqlx-cli
:cargo install sqlx-cli
. - Run migrations:
sqlx migrate run
. - Set environment variables:
DATABASE_URL
- the URL of your MySQL database (mysql://user[:password]@domain/database
)
- Build:
cargo build --release
Configuring
Reminder Bot reads a number of environment variables. Some are essential, and others have hardcoded fallbacks. Environment variables can be loaded from a .env file in the working directory.
Required Variables
DATABASE_URL
- the URL of your MySQL database (mysql://user[:password]@domain/database
)DISCORD_TOKEN
- your application's bot user's authorization token
Other Variables
MIN_INTERVAL
- default600
, defines the shortest interval the bot should acceptLOCAL_TIMEZONE
- defaultUTC
, necessary for calculations in the natural language processorSUBSCRIPTION_ROLES
- defaultNone
, accepts a list of Discord role IDs that are given to subscribed usersCNC_GUILD
- defaultNone
, accepts a single Discord guild ID for the server that the subscription roles belong toPYTHON_LOCATION
- default/usr/bin/python3
. Can be changed if your Python executable is located somewhere elseTHEME_COLOR
- default8fb677
. Specifies the hex value of the color to use on info message embeds