from api import command, message, plugin
def onInit(plugin_in):
tolower_command = command.command(plugin_in,
'tolower',
shortdesc='Convert text to lower case')
toupper_command = command.command(plugin_in,
'toupper',
shortdesc='Convert text to upper case')
return plugin.Plugin(plugin_in, 'texttools', [tolower_command])
def onCommand(message_in):
if message_in.command == 'tolower':
msg = message_in.body.lower()
return message.Message(body=msg)
elif message_in.command == 'toupper':
msg = message_in.body.upper()
return message.Message(body=msg)