summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins/rot13.rb
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 16:32:32 +0000
commit2a96c9198c1f6e13407d0999083f6ce5e0bc06fa (patch)
treeb3b9247d275d9b554665bc22884104d266d2e757 /lib/rbot/plugins/rot13.rb
parent21949774b91eaec6ecde4eaa8ad121e2c0a36b87 (diff)
move rbot into lib - still rearranging for packaging/installation
Diffstat (limited to 'lib/rbot/plugins/rot13.rb')
-rw-r--r--lib/rbot/plugins/rot13.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rbot/plugins/rot13.rb b/lib/rbot/plugins/rot13.rb
new file mode 100644
index 00000000..1f367dbd
--- /dev/null
+++ b/lib/rbot/plugins/rot13.rb
@@ -0,0 +1,14 @@
+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");
+ end
+end
+plugin = RotPlugin.new
+plugin.register("rot13")