transform: use new py3 base64 API

This commit is contained in:
Brian S. Stephan 2016-01-16 19:37:24 -06:00
parent 59c593f60b
commit 90d20dfe75
1 changed files with 2 additions and 2 deletions

View File

@ -51,9 +51,9 @@ class Transform(Plugin):
text = match.group(2)
if direction == 'encode':
return self.bot.reply(event, base64.encodestring(text).replace('\n', ''))
return self.bot.reply(event, base64.encodebytes(bytes(text, 'utf-8')).decode('utf-8'))
elif direction == 'decode':
return self.bot.reply(event, base64.decodestring(text).replace('\n', ''))
return self.bot.reply(event, base64.decodebytes(bytes(text, 'utf-8')).decode('utf-8'))
def handle_upper(self, connection, event, match):
"""Uppercase the text."""