Skip to content

Instantly share code, notes, and snippets.

@simbo1905
Last active February 11, 2019 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbo1905/b411406d790b0d4a9dfd68c69082e8fa to your computer and use it in GitHub Desktop.
Save simbo1905/b411406d790b0d4a9dfd68c69082e8fa to your computer and use it in GitHub Desktop.
how to make a botkit slack bot on OpenShift.com

fork the botkit slack starter repo

open https://github.com/howdyai/botkit-starter-slack

create a node.js app from your fork on openshift.com

open openshift.com

register a bot on api.slack.com

open https://api.slack.com

  1. create a new bot
  2. copy Client ID and Client Secret for .env file.
  3. setup oAuth redirect url http://ocd-slackbot-uniqkey-slackbot.e4ff.pro-eu-west-1.openshiftapps.com/oauth
  4. add a bot user with always logged in
  5. setup event subscriptions http://ocd-slackbot-uniqkey-slackbot.e4ff.pro-eu-west-1.openshiftapps.comm/slack/receive
  message.channels
  message.groups
  message.im
  message.mpim

clone your fork locally and edit two files

open .env for editing to add Client ID and Client Secret and also set port to 8080 from api.slack.com

use the bot

invite it to a room direct message it with "what is on my todo list today?"

setup an inbound webhook

open https://api.slack.com

go to "Incoming Webhooks" and activate inbound webhooks on your workspace, it will ask you which channel to post the text into, then you a curl command like:

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/TyyyyyyyJH/BFxxxxxx0Q/30tHrvvvvvvvvv5Qq97yFk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment