diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 16:32:32 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 16:32:32 +0000 |
commit | 2a96c9198c1f6e13407d0999083f6ce5e0bc06fa (patch) | |
tree | b3b9247d275d9b554665bc22884104d266d2e757 /lib/rbot/plugins/rot13.rb | |
parent | 21949774b91eaec6ecde4eaa8ad121e2c0a36b87 (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.rb | 14 |
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") |