Hacker News new | past | comments | ask | show | jobs | submit login

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?



Thanks!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: