All Posts Tagged “hubot”

Setup Hubot with Slack

Hubot is an extensible chat bot written in CoffeeScript.

ref:
https://hubot.github.com/

Installation

$ npm install -g yo generator-hubot

$ mkdir codebaku-hubot
$ cd codebaku-hubot
$ yo hubot

a list of adapters
https://hubot.github.com/docs/adapters/

You need to create a Hubot integration on your Slack to request an API token.

Local Development

Writing your own script
https://hubot.github.com/docs/scripting/

./bin/hubot --name hubot

# or

HUBOT_SLACK_TOKEN=YOUR_SLACK_TOKEN ./bin/hubot --adapter slack

I fork a script named hubot-reload-scripts to help you reload yours scripts when developing them.
https://github.com/vinta/hubot-reload-scripts

Debugging

Debugging Hubot Scripts using Node Inspector
https://gist.github.com/ejhayes/2879225
https://github.com/github/hubot/issues/648

$ npm install -g node-inspector coffee-script

$ node-inspector --no-preload --web-port 8123

# generate source map
$ coffee -m scripts/*.coffee
$ coffee --nodejs --debug node_modules/.bin/hubot --name hubot
$ coffee --nodejs --debug node_modules/.bin/hubot --adapter slack

$ boot2docker ip
$ open http://192.168.59.103:8123/?port=5858