3 ms·
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] == '!'
by snprbob86 15y ago
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!