Hipbot for your HipChat

Tomek Pewiński

Dec 18, 2012 • 3 min read

Hipbot came to life at one of Netguru’s famous hackathons, where all devs come together and write something cool in a couple of hours.


Hipbot came to life at one of Netguru’s famous hackathons, where all devs come together and write something cool in a couple of hours. As you know we use HipChat (and we love it), so naturally we thought of writing a bot that could assist us in our daily work. Something allowing us to easily add needed features in the language of our choice (which is Ruby).


Hipbot’s features make it really easy to add a functionality you need using dead simple DSL. There’s very little magic involved so if you can do it in ruby - you can do it in hipbot (which is great when hacking together another revolutionary idea). There’s also a simple API for making async HTTP requests, so possibilities are endless :) Hipbot does not come with plugins or built-in features as such - but you are unrestricted to write your own.

At a heart of hipbot is a routing system which reacts not only to certain messages, but also messages from certain people or in certain rooms (making it easy to implement permissions - for example deploying a project can be done only by ops in a project-specific room, but not from the company-wide chat).


Hipbot is built orthogonally - there’s a functional core which routes and reacts to messages, and communication adapters. Of course the biggest adapter is HipChatAdapter, but in the early days of development we tested it using TelnetAdapter too:) In theory it should be usable with any chat engine - just need to add an adapter.
Hipbot uses eventmachine and xmpp4r gems. Using eventmachine allows for concurrent, non-blocking IO, of which there is a lot in typical usage. Xmpp4r is pretty much framework-of-choice when it comes to jabber communication in ruby.

Some of problems we’ve encountered during the development:

  • xmpp4r is a really old library, and is not maintained anymore. We had to rewrite some parts of it in order to match our needs.
  • fetching data from HipChat (names and such) - HipChat XMPP API was in the experimental phase. At our request they’ve added fetching mentions, which allowed many useful (and fun) features.

Call to action

That’s pretty much it :) Hipbot is currently stable (you can easily deploy your own on heroku - here’s how), but I’m sure it could use some improvements. I encourage you to try it, send your feedback, or improve hipbot by submitting a pull request. People are also adding examples of their usage (some nice ideas there).

Help open source rock!

Also, you can read about how we use hipbot in the previous post.

More posts by this author

Tomek Pewiński

Codestories Newsletter

Read more on our Blog

Check out the knowledge base collected and distilled by experienced professionals.