Erik Zaadi

The tales of a developer with passion for dad jokes

Sane @hubot help

Everyone loves ChatOps

It’s all the rage lately, in the BOT ALL THE THINGZ era.

I’ve been writing ChatBots for a couple of years now, and I’ve always used Hubot.

Hubot worked fine for me when I was using IRC, HipChat and now even Slack.

Hubot has autogenerated help

Which is really cool, as you can do a simple @hubot help to see the available commands.

However

This can get extremely annoying in ChatOps war rooms.

Imaging going over a hellish pagerduty night of chat logs, and instead of seeing what the problem was, you see 1831KB of something like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
foo: @hubot show current loads
hubot: http://url.to/graph.png
bar: @hubot help
hubot:
    deploy
    patch
    graph
    bla
    ...
foo: @hubot patch all the thingz
hubot: ZOMG foo, I patched all the thingz
bar: @hubot help
hubot:
    deploy
    patch
    graph
    bla
    ...

Well this sucks

Wouldn’t it be much better if @hubot would reply with help content in private?

MIND BLOWN!

MIND BLOWN

I submitted a small PR in the matter, which luckily was merged!

Now if you add the environment variable HUBOT_HELP_REPLY_IN_PRIVATE, @hubot will reply with the help content in private to whomever asked.

Live long and ZOMG

Share on: