samanthaeschaffer / slack-rails-bot-starter

Rails Slack Bot Starter Kit built on top of the Slack Ruby Bot Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slack Rails Bot Starter

Setup

Prerequisites(Recommended)

A domain(or a subdomain) is ready to host the application

If you need to set up a new Slack app:

  1. Create a new app here
  2. Navigate to the OAuth & Permissions page and add the following Bot Token Scopes:
  • users:read
  • channels:read
  • groups:read
  • chat:write
  • commands
  • incoming-webhook
    BASE_URL stands for https://slackbot-hosted-domain.com hereafter.
    Use this url for Redirect : BASE_URL
  1. Activate Interactivity & Shortcuts and add this url: BASE_URL/api/slack/action
  2. Activate Slash Commands adding two slash commands /ping, /quiz and use this url: BASE_URL/api/slack/command
  3. Activate Event Subscriptions subscribing to the event type member_joined_channel and add this url: BASE_URL/api/slack/event(This step needs the application to be running :D so you can skip this and come back a few mins later)
  4. Navigate to the App Home page and toggle Always Show My Bot as Online (according to your reference)

Clone the repository and install dependencies

bundle install

Prepare .env file

cp .env.example .env

Go to https://api.slack.com/apps and click your application.
Grab the infomation needed for .env file from Basic Information section.

Run the application

Use this command to run the app on your server:

rails s -e production -b 0.0.0.0

Open the BASE_URL in your browser

Deployment

Not limited to any specific platform

License

MIT

TODO

[x] Change the interactive message templates to the new ones
[ ] Add Rubocop linting
[ ] Add Specs
[ ] Add TravisCI build flow
[ ] Add Contribution Guide

Credit

This project is built on top of the Slack Ruby Bot Server and Slack Ruby Bot Server Events
A big thanks to Daniel Doubrovkine's great work.

Made with ❤️ by CrazyOptimist 🐬

About

Rails Slack Bot Starter Kit built on top of the Slack Ruby Bot Server

License:MIT License


Languages

Language:Ruby 90.0%Language:JavaScript 5.0%Language:HTML 4.2%Language:Shell 0.9%