transform: use new py3 base64 API
This commit is contained in:
parent
59c593f60b
commit
90d20dfe75
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user