This is a boilerplate for building slack apps with Ruby on Rails.
The default branch master uses Mongoid as database adapter. For ActiveRecord, please check postgres branch.
- FQDN(Fully Qualified Domain Name) to host the app publicly. You can also choose to use ngrok instead.
- Create a new app here
- Navigate to the OAuth & Permissions page and add the following Bot Token Scopes:
users:readchannels:readgroups:readchat:writecommandsincoming-webhookBASE_URL stands for https://slackbot-hosted-domain.com hereafter. Use BASE_URL for Redirect.
- Activate Interactivity & Shortcuts and add this url:
BASE_URL/api/slack/action - Activate Slash Commands adding two slash commands
/ping,/quizand use this url:BASE_URL/api/slack/command - Activate Event Subscriptions subscribing to the event type
member_joined_channeland 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) - Navigate to the App Home page and toggle Always Show My Bot as Online (according to your reference)
bundle installcp .env.example .envGo to https://api.slack.com/apps, click on your application.
Checkout what's needed for .env from the Basic Information section.
rails sOpen BASE_URL in your browser.
Please follow the standard Ruby on Rails application deployment methods.
Thanks in advance for your contribution!
- Fork the project (https://docs.github.com/en/get-started/quickstart/fork-a-repo)
- Create your own branch with a meaningful name
- Install dependencies by running
bundle install - Make changes and push your commits
- Create a pull request
- Add a PR description explaining what it is for.
This boilerplate uses Slack Ruby Bot Server Events.
Thanks to Daniel Doubrovkine and all the contributors.
Made with ❤️ by crazyoptimist