TextTransform: add a !lower
how i got so far without adding this i'll never know
This commit is contained in:
parent
17040c1cde
commit
f8974dd240
@ -42,6 +42,8 @@ class TextTransform(Module):
|
|||||||
return self.reply(connection, event, reply[0])
|
return self.reply(connection, event, reply[0])
|
||||||
elif self.upper(what, reply):
|
elif self.upper(what, reply):
|
||||||
return self.reply(connection, event, reply[0])
|
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):
|
elif self.al_bhed(what, reply):
|
||||||
return self.reply(connection, event, reply[0])
|
return self.reply(connection, event, reply[0])
|
||||||
|
|
||||||
@ -84,6 +86,17 @@ class TextTransform(Module):
|
|||||||
reply[0] = text.upper()
|
reply[0] = text.upper()
|
||||||
return True
|
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):
|
def al_bhed(self, what, reply):
|
||||||
"""
|
"""
|
||||||
Convert a string to al bhed.
|
Convert a string to al bhed.
|
||||||
|
Loading…
Reference in New Issue
Block a user