Slack Ruby Bot Server

Gem Version Build Status Code Climate

An opinionated boilerplate and demo for a complete Slack bot service with Slack button integration, in Ruby. If you are not familiar with Slack bots or Slack API concepts, you might want to watch this video. A good demo of a service built on top of this is playplay.io.

Try Me

A demo version of this app is running on Heroku at slack-ruby-bot-server.herokuapp.com. Use the Add to Slack button. The bot will join your team as @slackbotserver.

Once a bot is registered, you can invite to a channel with /invite @slackbotserver interact with it. DM "hi" to it, or say "@slackbotserver hi".

What is this?

A Grape API serving a Slack Ruby Bot to multiple teams. This gem combines a web server, a RESTful API and multiple instances of slack-ruby-bot. It integrates with the Slack Platform API. Your customers can use a Slack button to install the bot.

Run Your Own

You can use the sample application to bootstrap your project and start adding slack command handlers on top of this code.

Install MongoDB, required to store teams.

Create a New Application on Slack.

Follow the instructions, note the app's client ID and secret, give the bot a default name, etc. The redirect URL should be the location of your app, for testing purposes use http://localhost:9292. Edit your .env file and add SLACK_CLIENT_ID=... and SLACK_CLIENT_SECRET=... in it. Run bundle install and foreman start. Navigate to localhost:9292. Register using the Slack button.

If you deploy to Heroku set SLACK_CLIENT_ID and SLACK_CLIENT_SECRET via heroku config:add SLACK_CLIENT_ID=... SLACK_CLIENT_SECRET=....

Examples Using Slack Ruby Bot Server

Copyright Daniel Doubrovkine, 2015-2016

MIT License