Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
IRCEvent.add_callback('privmsg') do |event| unless event.channel == bot.nick if event.message =~ /^!(.+)/ line = $1.split if $commands[line.first].nil? bot.send_message(event.channel, "What?!?") else $commands[line.shift][1].call(event, line.join(' ')) end end else ## PRIVMSG ## XXX: not working: # FBSDBot.handle_privmsg(event) end end
This paste will be private.
From the Design Piracy series on my blog: