Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2011 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1016663 to your computer and use it in GitHub Desktop.
Save anonymous/1016663 to your computer and use it in GitHub Desktop.
irc = require 'irc'
bot = new irc.Client 'hub.irc.hu', 'Arthur', debug:true, channels: ['#nonesuch']
Array::random = ->
@[Math.floor Math.random()*@length]
electric_brain = ["What?", "I don't understand", "Where's the tea?"] # who'd know the difference?
bot.addListener 'message', (from, to, message) ->
bot.say to, electric_brain.random()
process.on "SIGINT", ->
bot.disconnect "Goodbye cruel world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment