This is a Hubot adapter to use with Slack.
npm install hubot -ghubot --create [path_name]cd [path_name]npm install hubot-slack --save- Initialize git and make your initial commit
- Check out the hubot docs for further guidance on how to build your bot
./bin/hubot
This is a modified set of instructions based on the instructions on the Hubot wiki.
-
Make sure
hubot-slackis in yourpackage.jsondependencies -
Edit your
Procfileand change it to use theslackadapter:web: bin/hubot --adapter slack -
Install heroku toolbelt if you haven't already.
-
heroku create my-company-slackbot -
heroku addons:add redistogo:nano -
Activate the Hubot service on your "Team Services" page inside Slack.
-
Add the config variables. For example:
% heroku config:add HEROKU_URL=http://soothing-mists-4567.herokuapp.com % heroku config:add HUBOT_SLACK_TOKEN=dqqQP9xlWXAq5ybyqKAU0axG % heroku config:add HUBOT_SLACK_TEAM=myteam % heroku config:add HUBOT_SLACK_BOTNAME=slackbot -
Deploy and start the bot:
% git push heroku master % heroku ps:scale web=1 -
Profit!
This adapter uses the following environment variables:
This is the service token you are given when you add Hubot to your Team Services.
This is your team's Slack subdomain. For example, if your team is https://myteam.slack.com/, you would enter myteam here.
Optional. What your Hubot is called on Slack. If you entered slackbot here, you would address your bot like slackbot: help. Otherwise, defaults to hubot.