diff --git a/modules/TextTransform.py b/modules/TextTransform.py index d4948d1..f816db9 100644 --- a/modules/TextTransform.py +++ b/modules/TextTransform.py @@ -42,6 +42,8 @@ class TextTransform(Module): return self.reply(connection, event, reply[0]) elif self.upper(what, reply): return self.reply(connection, event, reply[0]) + elif self.lower(what, reply): + return self.reply(connection, event, reply[0]) elif self.al_bhed(what, reply): return self.reply(connection, event, reply[0]) @@ -84,6 +86,17 @@ class TextTransform(Module): reply[0] = text.upper() return True + def lower(self, what, reply): + """ + Convert a string to lowercase. + """ + + match = re.search('^!lower\s+(.*)$', what) + if match: + text = match.group(1) + reply[0] = text.lower() + return True + def al_bhed(self, what, reply): """ Convert a string to al bhed.