Create API Key
The Hubot interface needs access to the Slack API. This is granted through a bot API token.
- Log into Slack via the web portal and browse to new bot page.
- Enter a username for your bot and click ‘Add bot integration’
- Copy the API tocken for later use.
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y build-essential nodejs tcl redis-server
Create Your Hubot
First we need a user to run the Hubot instance
sudo useradd --home /opt/hubot hubot
Next we install the Hubot generator
sudo npm install -g hubot coffee-script yo generator-hubot
Finally we can create the Hubot
cd /opt/hubot sudo su - hubot yo hubot
HUBOT_SLACK_TOKEN=xoxb-1234-5678-91011-00e4dd ./bin/hubot --adapter slack
Jump onto slack and invite hubot into general. Confirm it works by typing @hubot help
You can run Hubot in the background using the likes of
screen. Alternitively, you could run it as a daemon,
however, I haven’t had any luck with that.