From c40f14e0f345272beb43a9781bdd0ea58e557f43 Mon Sep 17 00:00:00 2001 From: William Mathewson Date: Mon, 14 Jan 2019 17:02:18 +0000 Subject: [PATCH] Add rot13 plugin --- ircbot/plugins/rot.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ircbot/plugins/rot.py diff --git a/ircbot/plugins/rot.py b/ircbot/plugins/rot.py new file mode 100644 index 0000000..62b051e --- /dev/null +++ b/ircbot/plugins/rot.py @@ -0,0 +1,17 @@ +import codecs + +from ircbot import bot + + +@bot.command('rot13') +def rot13(bot, channel, sender, args): + """ + Usage: {bot.trigget}rot13 + + Applies the Caesar cypher to the string and returns it. Currently only supports rot-13. + """ + if not args: + bot.message(channel, f"USAGE: {bot.trigger}rot13 ") + return + + bot.message(channel, "{}: {}".format(sender, codecs.encode(' '.join(args), 'rot-13')))