This is an implementation of the WhosInBot in Clojure.
Check out the Scala, Rust, and Col's original Elixir and Go versions.
An instance of this Telegram bot has been deployed and running. To start using, simply add @whosincljbot
to a group chat and type /start_roll_call
.
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
-
Create a Telegram bot for development and obtain the authorization token.
-
Copy
resources/config.template-dev.edn
toresources/config.edn
and fill in the Telegram token. -
Start the development PostgreSQL and Redis with Docker Compose:
docker-compose up -d
This automatically creates
whosin_dev
andwhosin_test
databases.
-
Apply dev database migrations:
lein migrate
-
Apply test database migrations:
ENVIRONMENT=test lein migrate
-
Run tests:
lein test
-
Run the app locally:
lein run
-
Make sure
resources/config.edn
has the correct values. -
Build the JAR:
lein uberjar
The standalone JAR will be generated at
target/uberjar/whosin-standalone.jar
. -
Apply database migrations:
java -jar target/uberjar/whosin-standalone.jar --migrate
-
Run the app:
java -jar target/uberjar/whosin-standalone.jar
- A basic CI/CD pipeline with Travis CI and Heroku (Worker Dyno) is included.
- PostgreSQL 9.6 and above is recommended.
- Redis is required for rate limiting incoming messages.
- Create a Telegram bot for production and obtain the authorization token.
- Optional: Create a project on Sentry and obtain the DSN.
- Create a project on Heroku and add
TELEGRAM_TOKEN
andSENTRY_DSN
as Config Vars with values from step 1 and 2. - Provision PostgreSQL and Redis on Heroku.
- Obtain the Heroku API key from Account Settings.
- Set up the project on Travis CI and add
HEROKU_API_KEY
andHEROKU_APP_NAME
as Environment Variables. - Trigger a new build and deployment from Travis.
- Once the deployment completes, go to Heroku Dashboard and enable the Worker Dyno under Resources.