This is an implementation of the WhosInBot in Rust.
Check out the Clojure, Scala, and Col's original Elixir and Go versions.
Refer to the original WhosInBot for the full usage description.
/start_roll_call- Start a new roll call/start_roll_call Some cool title- Start a new roll call with a title/set_title Some cool title- Add a title to the current roll call/end_roll_call- End the current roll call
/in- Let everyone know you'll be attending/in Some random comment- Let everyone know you'll be attending, with a comment/out- Let everyone know you won't be attending/out Some excuses- Let everyone know you won't be attending, with a comment/maybe- Let everyone know that you might be coming/maybe Erm..- Let everyone know that you might be coming, with a comment/set_in_for Dave- Let everyone know that Dave will be attending (with an optional comment)/set_out_for Dave- Let everyone know that Dave won't be attending (with an optional comment)/set_maybe_for Dave- Let everyone know that Dave might be coming (with an optional comment)/whos_in- List attendees
/shh- Tells WhosInBot not to list all attendees after every response/louder- Tells WhosInBot to list all attendees after every response
-
Install Diesel ORM CLI (optional):
cargo install diesel_cli --no-default-features --features postgres -
Create a Telegram bot for development and obtain the authorization token.
-
Copy
config/main.template.tomltoconfig/main.tomland fill in the Telegram token. -
Start the development PostgreSQL with Docker Compose:
docker-compose up -dThis automatically creates the
whosin_devdatabase.
-
Apply dev database migrations:
cargo run --bin migrate -
Run tests (which require Nightly Rust):
cargo +nightly test -
Run the app:
cargo run --bin whosinbot
-
Build for Release (optimized):
cargo build --releaseThis generates the Release binaries for
whosinbotandmigrateintarget/release. -
Apply database migrations:
env DATABASE_URL=postgres://[DB_USER]:[DB_PASSWORD]@[DB_HOST:DB_PORT]/[DB_NAME] \ SENTRY_DSN=[SENTRY_DSN] \ target/release/migrate -
Run the Release build:
env DATABASE_URL=postgres://[DB_USER]:[DB_PASSWORD]@[DB_HOST:DB_PORT]/[DB_NAME] \ TELEGRAM_TOKEN=[TELEGRAM_TOKEN] \ SENTRY_DSN=[SENTRY_DSN] \ target/release/whosinbot