leo-bot

leo-bot is a very simple bot based on Botkit to notice you when it's time to pick up your child at school!

Screen capture of the Slack bot

Installation

npm install

Deploy

Node.js and Redis are required.

Configuration

You need to set environment variables (See .env.dist):

The cron-style scheduling format consists of:

*    *    *    *    *    *
┬    ┬    ┬    ┬    ┬    ┬
│    │    │    │    │    |
│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
│    │    │    │    └───── month (1 - 12)
│    │    │    └────────── day of month (1 - 31)
│    │    └─────────────── hour (0 - 23)
│    └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)

Usage

# Served with hot reload (+ ESLint verification).
npm run dev

# Start server in production environment.
npm run start

Supported Slack commands

Just ask help to @leo-bot.

Deploy

Heroku (CLI)

heroku create --buildpack https://github.com/heroku/heroku-buildpack-nodejs.git
heroku addons:create heroku-redis:hobby-dev
heroku config:set CHILD='Léo'
heroku config:set CHANNEL='#leo'
heroku config:set SCHEDULE='0 45 17 * * 1-5'
heroku config:set SLACK_BOT_TOKEN=xoxb-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX
heroku config:set TZ=Europe/Paris
heroku ps:scale web=0 worker=1

Development

This project uses ESLint for its syntax. You should read some documentation before.

# Run ESLint to check if code respects it's syntax.
npm run lint

Source

https://github.com/ArnaudLigny/leo-bot

License

leo-bot is a free software distributed under the terms of the MIT license.

© Arnaud Ligny