Skip to content

Latest commit

 

History

History
97 lines (80 loc) · 3.67 KB

README.md

File metadata and controls

97 lines (80 loc) · 3.67 KB

gistbot

Just mention or DM @gistbot in any channel and it will upload a new Github Gist for you!

screen shot 2017-07-17 at 9 51 35 pm

Getting Started

This is the longest getting started guide, but AFAIK there isn't an easier setup flow. Open to PR that can help make it shorter!

Development Environment

Install Ngrok

  1. Go to https://ngrok.com/download
  2. Select the Download URL that matches your System
  3. Unzip the File and put it somewhere you'll remember
  4. (optional) create an alias for ngrok
# In ~/.bashrc
alias ngrok="~/Dropbox/ngrok http"
  1. Now set your source to new bashrc source ~/.bashrc
  2. Run ngrok 9001 ( you may need to create account / sign in )
  3. Stop Ngrok for now

Setup Local Bot

  1. In Bot directory copy sample env file cp etc/.env.sample.js etc/.env.development.js
  2. Install node_modules yarn install
  3. Run the App yarn run start
  4. In a seperate tab run ngrok 9001
  5. Leave your Bot Server and Ngrok Running

Configure Slack App

  1. Make sure you are signed into your team and can view admin ex. https://clintonslackbots.slack.com/admin
  2. Go to Slack Apps Admin https://api.slack.com/apps?new_app=1
  3. Fill in App Name and Select your Slack Team
  4. Click "Create App"
  5. You should be on the "Basic Information Screen"
  6. In the Left Rail Click "Features > Bot Users"
  7. Click "Add Bot User" Fill in your bot name gistbot
  8. If you don't plan on using an RTM connection flip "Always Show My Bot as Online" on.
  9. Click Add Bot User
  10. In the Left Rail Click "Features > Interactive Messages"
  11. Click "Enable Interactive Messages"
  12. Paste Your ngrok url in the Request Url field https://3d5fc033.ngrok.io/slack
  13. Click Enable Interactive Messages
  14. In the Left Rail Click "Features > Event Subscriptions"
  15. Toggle Events on
  16. Paste your webhook endpoint in the Request URL Field
  17. Scroll Down to Subscribe to Bot Events
  18. Add the Following Events
message.channels
message.groups
message.im
  1. Click Save Change
  2. In the Left Rail Click "Settings > Basic Information"
  3. Copy Client Id, Client Secret and paste those in etc/.env.development.js
  4. In the Left Rail Click "Features > Oauth & Permissions"
  5. Under Redirect URL's add your ngrok oauth endpoint ex. https://3d5fc033.ngrok.io/oauth
  6. Click "Save Urls"
  7. Click "Install App To Team"
  8. Copy the "Bot User OAuth Access Token" and paste in the token field of etc/.env.development.js
  9. Restart Your Slack bot CTRL C and yarn run start
  10. Finally Go To "Manage Distribution"
  11. Click the "Add To Slack" button
  12. Go through Oauth Process
  13. You can now message your bot!
  14. If you've made it this far you can go grab a beer or tea if that's your thing 😎

Resuming development

In order for your local environment to work you'll need to ensure that the Slack app has the correct ngrok URL. I just bookmark my slack app in chrome.

ex. https://api.slack.com/apps/xxx/event-subscriptions

  1. Start Botkit Server yarn run start
  2. New Tab ngrok 9001
  3. Go to Slack Settings Features > Interactive Messages
  4. Paste new Ngrok URL in Request URL
  5. Go to Features > Event Subscriptions
  6. Click Change in Request URL
  7. Paste new Ngrok URL in Request URL

We're Hiring

Are you looking to work on chatbots, API's and cool frontend app's?

Check out our sites

Please reachout to [email protected] or [email protected] for more details!