]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/rot13.rb
Fri Jul 29 13:07:56 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / rot13.rb
index 1f367dbda9933ec3881ca10b0b9efd517ec8bf95..28e9243f5fc0a779401fe1d72bf54aae211a3507 100644 (file)
@@ -2,13 +2,9 @@ class RotPlugin < Plugin
   def help(plugin, topic="")
     "rot13 <string> => encode <string> to rot13 or back"
   end
-  def privmsg(m)
-    unless(m.params && m.params =~ /^.+$/)
-      m.reply "incorrect usage: " + help(m.plugin)
-      return
-    end
-    m.reply m.params.tr("A-Za-z", "N-ZA-Mn-za-m");
+  def rot13(m, params)
+    m.reply params[:string].tr("A-Za-z", "N-ZA-Mn-za-m");
   end
 end
 plugin = RotPlugin.new
-plugin.register("rot13")
+plugin.map 'rot13 :string'