diff options
Diffstat (limited to 'rbot/plugins/rot13.rb')
-rw-r--r-- | rbot/plugins/rot13.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rbot/plugins/rot13.rb b/rbot/plugins/rot13.rb new file mode 100644 index 00000000..1f367dbd --- /dev/null +++ b/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") |