Skip to content
From Google Sheets comes a daily Slack chore notification
JavaScript Dockerfile
Branch: master
Clone or download
Latest commit 0a7b240 Nov 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update master-pr-check-version.yml Oct 19, 2019
utilities Merged dev Nov 2, 2019
.dockerignore Use explicit 12-alpine tag and some cleanup Oct 8, 2019
.drone.yml add dev deployment pipeline Oct 5, 2019
.env.example Update env Nov 2, 2019
.eslintrc.json
.gitignore not working but I don't want to lose my work Sep 20, 2019
Dockerfile Use explicit 12-alpine tag and some cleanup Oct 8, 2019
LICENSE Create LICENSE Sep 20, 2019
README.md reword README things Nov 2, 2019
package-lock.json Merged dev Nov 2, 2019
package.json Bump version Nov 2, 2019
server.js Update env Nov 2, 2019

README.md

Build Status

forthebadge forthebadge

ChoreBot

ChoreBot is primarily a service that takes assigned tasks right from a Google Sheet and posts them in a Slack channel. It allows chores to be assigned well in advance to ease the life of whoever does the scheduling. Secondarily, ChoreBot feeds headsup with chore data to keep our info board updated.

Setup

Setup of ChoreBot involves a few steps, but it isn't very difficult. You'll need to create an app on Slack, load our code onto your server, make a service account on Google, and set some environment variables.

Slack

  1. Head over to Slack's app portal, and create a new app.
  2. Make sure you turn on "interactive components" and set your request URL to wherever you will be hosting the app. By default, Bolt's event endpoint is /slack/events, so your URL should probably end in that.
  3. Create a bot user and call it whatever you wish.
  4. After that, head up to "Install App" and install your app. Slack will take you through the permission approval process. You'll probably end up with an email that says you added an integration to your workspace.
  5. Take note of the Bot User OAuth Access Token and the Signing Secret, the latter of which can be found on the "Basic Information" page.

Google

Two things are needed from Google: a spreadsheet must be created, and a service account must be made and given access to the sheet.

Spreadsheet

Your spreadsheet should comply with the following format:

Date Chore
2019-10-04 Chore1
2019-10-04 Chore2
2019-10-05 NextDayChore1
.. ..

Note the format of the date (YYYY-MM-DD) and the fact that multiple chores can be listed per day, so long as the Date remains constant. If desired, you can use standard sheets formulas to produce any of the data in the spreadsheet.

Service account

Create a service account using these instructions. Once it's created, share the previously created spreadsheet with the service account's address. View-only permissions should be fine; we're only reading data from the sheet.

Your server

You can easily deploy this app using Docker Compose. Your docker-compose.yml file should look something like the following (we use Traefik for routing, FYI):

chorebot:
  build: https://github.com/rpiambulance/chorebot.git
  container_name: chorebot
  restart: always
  mem_limit: 500m
  labels:
    - "traefik.port=3000"
    - "traefik.frontend.rule=Host:chorebot.your_server_address.com"
  environment:
    - SPREADSHEET_ID=<spreadsheet ID>
    - SLACK_BOT_TOKEN=<xoxb Slack token>
    - SLACK_SIGNING_SECRET=<signing secret>
    - CHORES_CHANNEL=<channel>
    - CRON_SCHEDULE=0 18 * * *
    - TZ=America/New_York
  volumes:
    - /drone/chorebot/keys/sheets-api.json:/usr/src/app/keys/sheets-api.json

Fill in the environment variables as appropriate, and run a docker-compose up -d chorebot, or whatever you named your service.

Credits

Developers

License

ChoreBot is provided under the MIT License.

Contact

For any question, comments, or concerns, email dev@rpiambulance.com, create an issue, or open up a pull request.

You can’t perform that action at this time.