Re:Scaling GitHub's Employees
by brown9-2 on Thursday September 29, 2011 @09:36PM
(#3055161)
God I wish my team had a Hubot.
[ Parent
| on HN ]
I coded up a HipChat bot in < 100 lines of CoffeeScript. It leverages the existing module system to make plugin writing hilariously easy:
if msg[0] == '!'
[cmd, args...] = msg.slice(1).split(' ')
require("commands/#{cmd}").exec(chat, args)
Just add a coffee file to the commands directory and export an `exec` function which callc `chat.reply` -- couldn't be easier!Hmm, would you have any pointers on where to start with CoffeeScript to do something like this?