add rot/unrot

This commit is contained in:
Gordon Shumway 2019-11-18 01:10:22 -05:00 committed by GitHub
parent a46a0164fe
commit 156e0c7649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,5 +270,15 @@ class Fun(callbacks.Plugin):
excuse = random.randrange(0, len(reply))
irc.reply(reply[excuse])
chuck = wrap(chuck)
def rot(self, irc, msg, args, text):
"Encode text with ROT13"
irc.reply(codecs.encode(text, "rot_13"))
rot = wrap(rot, ['text'])
def unrot(self, irc, msg, args, text):
"Decode ROT13 text"
irc.reply(codecs.decode(text, "rot_13"))
unrot = wrap(unrot, ['text'])
Class = Fun