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')))