]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - rbot/plugins/rot13.rb
initial import of rbot
[user/henk/code/ruby/rbot.git] / rbot / plugins / rot13.rb
1 class RotPlugin < Plugin
2   def help(plugin, topic="")
3     "rot13 <string> => encode <string> to rot13 or back"
4   end
5   def privmsg(m)
6     unless(m.params && m.params =~ /^.+$/)
7       m.reply "incorrect usage: " + help(m.plugin)
8       return
9     end
10     m.reply m.params.tr("A-Za-z", "N-ZA-Mn-za-m");
11   end
12 end
13 plugin = RotPlugin.new
14 plugin.register("rot13")