My work recently migrated from HipChat to Slack. Not wanting to leave our beloved hubot behind, I set about changing the configuration to bring it over. It turned out to be pretty straightforward, but since existing articles covered setting it up from scratch, I used the excuse to dust the cobwebs off my blog and write a specific guide.
- Create a bot in Slack, and retrieve the app token
In your hubot code
- Add the Slack module
"hubot-slack":"^4.3.4"to hubot’s dependencies in
- Amend the hubot command option in
Procfileto use the Slack option:
web: bin/hubot -a slack --alias <bot name>
- Add a config variable
HUBOT_SLACK_TOKENand give it the value of the Slack token (should start with
- Deploy the code through Heroku
And that’s it! hubot should then show up as active user on the Slack (if running in Heroku) and respond to script prompts.