Last Updated: July 27, 2016
· krry

Bring a robot

Ever find yourself in a chat room without a helper robot?

I know I have. These days I won't set foot in one without my trusty @raybot though.

You should have a robot too.

And you can, for free, with Github's hubot and Heroku. All told it took me about 4 hours to get hubot live and configured with 70 of my favorites scripts. But I tend to go 110% when adopting new tech. I'll bet you can do it in 20 minutes if you're a wiz.

Here's the basic order of operations:

  1. Set up your hubot by following the setup instructions.
  2. Deploy it on Heroku.
  3. Customize to your heart's content with all the scripts in the catalog
  4. Install dependencies for the additional scripts you install: `npm install <dependency> --save'
  5. Set configuration variables for the additional scripts via the CLI. Locally you can fire up a bash shell and run export <CONFIGURATION_VARIABLE>=<value>. To set them on your heroku server, use the Toolbelt like so: heroku config:add <CONFIG_VAR>=<value>. You don't need to wrap the values or the variable name in quotes, e.g., export HUBOTIRCROOMS=krry uxioms
  6. Add it to your IRC, your Skype rooms, Campfire chats, Gtalk, etc., with some node modules and environment variables.

And remember, as a node app, hubot's mothertongue is JSON. So if you're savvy you can directly configure most things by editing hubot-scripts.json and package.json. Or you go the safe routes and add .coffee scripts to the scripts/ directory and modules through npm.

Protip: set up a mongoDB on your heroku instance so your hubot's data can persist across sessions, updates, and reboots. I went with mongolab (heroku addons:add mongolab) because it's free and I had already tried MongoHQ on another project. You'll have to add the script to your hubot-scripts.json, and a few configuration variables that it specifies in the comments at the top.

Here's the cool part

By adding some scripts, you can teach your hubot all kinds of awesome tricks, from fetching you GIFs of anything with, to keeping track of everyone's karma points with, to coming up with a great excuse for you with Hubot can be as useful or as amusing as you want. You can even rig up FOAAS to keep things/people in their place without straining your cuss-muscles.

And that's what's up on the hubot tip

May you never feel alone in a noisy, crowded chat room again.

3 Responses
Add your response

Hey could you explain why chat rooms and bots are so popular and why should a team use them?

over 1 year ago ·

@dpashkevich I think realtime communication is much better than emails. And having all in the same place you can have history of everything. Bots are popular because help you, you can ask a bot to find something for you, to deploy stuff for you or he can tell you when something is not going how it should.

over 1 year ago ·

So I guess this is more relevant to distributed teams, not the ones that work in the same office?

over 1 year ago ·