Skip to content
A friendly Slack bot to organize your lunch break built with Zenaton.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.zenaton
routes
views/pages
zenaton
.env.example
.gitignore
Procfile
README.md
app.json
index.js
package.json
slackInteractions.js
yarn.lock
zenatonBoot.js
zenatonClient.js

README.md

Where to lunch

A friendly Slack bot to organize a daily vote for where to lunch nearby.

  • Automatically post a list of nearby restaurants every day.
  • Invite coworkers to vote on their preference.
  • Change the vote time and window to suite your schedule.
  • Go to Lunch!

This bot is built with Zenaton, a developer framework to orchestrate multiple services and APIs into your software application using logic triggered by events and time.

The bot uses two Zenaton workflows:

It also uses the Zenaton scheduler to easily launch recurrent vote using cron expressions.

Quick Start

1. Deploy and install your own bot instance

2. On Slack type /wheretolunch configure [your address] to set your current location

3. On Slack type /wheretolunch vote_now to launch a vote for all channel members

All available commands

Once your Slack app is installed on your workspace use the following slack commands to configure Where to Lunch:

/wheretolunch help: list all available commands

/wheretolunch configure [your address]: configure your current location

/wheretolunch vote_now: launch a vote in the current Slack channel

/wheretolunch schedule_vote 15 11 * * MON-FRI: schedule the vote based on the cron format

Deploy and install your own instance

To deploy your own instance you will need a:

  • Zenaton account (the workflow engine)
  • Airtable account (the database)
  • Google Places API key (to find places near your location)
  • Slack application

1. Fork this project

2. Go to your Zenaton account and create a new application

3. Go to your Airtable account and create a new database and a table named Places

Add the following columns to your table:

  • id
  • place_id
  • team_id
  • channel_id
  • name
  • address
  • payload

4. Create a new Slack application

5. Deploy the code

Click on this button from your forked project:

Deploy to Heroku

You will have to provide the following environment variables:

  • ZENATON_APP_ID
  • ZENATON_API_TOKEN
  • ZENATON_APP_ENV
  • GOOGLE_PLACES_API_KEY
  • AIRTABLE_API_KEY
  • AIRTABLE_BASE_ID
  • AIRTABLE_PLACES_TABLE
  • SLACK_BOT_TOKEN
  • SLACK_SIGNING_SECRET

If you want to deploy your app on another cloud provider look at the documentation.

6. Configure your Slack application

Add a new slash command

  • Command: /wheretolunch
  • Request URL: https://YOUR_APP.herokuapp.com/slack/wheretolunch

Enable Interactive Componements

  • Request URL: https://YOUR_APP.herokuapp.com/slack/actions

Add a bot user

  • Display Name: Where to lunch

7. Add the slack application to your workspace

8. You can now use your Slack bot!

Development

Run your development web server using node.js and yarn.

$ yarn install
$ yarn dev

You can then use ngrok to make your local web server accessible from the outside.

ngrok http 5000

Make sure to setup your ngrok public url for the Slack Slash Command and Interactive Componements.

You can’t perform that action at this time.