miam-bot

A very simple bot based on Botkit to notify a Slack channel when it’s time to order food on http://foodcheri.com! miam-bot is Heavily inspired by uzfood-bot.

Slack screen capture

Installation

npm install

Slack token

You need to set an environment variable:

export SLACK_BOT_TOKEN="xoxb-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX"

You’ll find your Slack token at https://my.slack.com/apps/A0F7YS25R-bots.

Configuration

See config.json file.

Slack channel

Set CHANNEL key.

By default, the bot daily message is sent to:

Reminder schedule

Set SCHEDULE key.

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

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

# Start server in production environment.
npm run start

Supported commands

Just ask help to @miam-bot.

Deploy

Heroku

heroku create --buildpack https://github.com/heroku/heroku-buildpack-nodejs.git
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.

License

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

Copyright (c) 2017, AdFab