Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Hubot in Slack

This seems like a stupid question.

I have deployed Hubot to Heroku and set the configs given from Slack per this instruction. However I don't know if Hubot should show up as a member in my team or not. I can post a message via REST and the log says that a message is received.

Should Hubot become a member in a team that I can send direct message to or there is something I am missing?

like image 846
Khanetor Avatar asked Aug 26 '14 18:08

Khanetor


Video Answer


2 Answers

Hubot doesn't appear as a team member in Slack, but it will still be sitting in your channels and dutifully listening (if you've properly set everything up). Just directly call it by whatever name you gave it, and it should respond. So if you set:

HUBOT_SLACK_BOTNAME=hubot

...in Heroku, then hop into the #general channel in Slack and ping Hubot:

hubot help

like image 102
redhotvengeance Avatar answered Sep 21 '22 20:09

redhotvengeance


The hubot slack integration seems to be somewhat lacking. If you want Hubot to look like an actual member, you can use the hubot-irc adapter and connect to your slack instance using the irc gateway. Make sure you have IRC enabled for your slack instance

  1. Create a "user" account for Hubot
  2. Login to your slack instance as your hubot user
  3. Goto https://yourdomain.slack.com/account/gateways
  4. Use the irc connection info in the Hubot specific variables for hubot-irc
  5. Fire up hubot and watch it connect

Just an example of the ./bin/slackbot file I use to load up hubot. I don't use mine on heroku but I imagine the variable setup should be similar.

# Make this file executable and run from your hubot directory

HUBOT_IRC_SERVER="yourdomain.irc.slack.com" \
HUBOT_IRC_ROOMS="#general,#random" \
HUBOT_IRC_NICK="slackbot" \
HUBOT_IRC_PASSWORD="yourdomain.1239586t437389" \
HUBOT_IRC_NICKSERV_PASSWORD="yourdomain.129319823719" \
HUBOT_IRC_UNFLOOD="false" \
HUBOT_IRC_USESSL=1
bin/hubot -a irc --name hitbot
like image 43
Aaron Avatar answered Sep 23 '22 20:09

Aaron