Get mentionable nick

This commit is contained in:
Joscha 2016-05-23 02:46:36 +02:00
parent 0159043895
commit aaab2b9bbf
2 changed files with 10 additions and 1 deletions

View file

@ -71,6 +71,15 @@ class Message():
else:
return time.strftime("%H:%M:%S", time.gmtime(self.time))
def mentionable(self):
"""
mentionable() -> str
Converts the name to a mentionable format.
"""
return "".join(c for c in self.name if not c in ",.!?;&<'\"" and not c.isspace()).lower()
def is_edited(self):
"""
is_edited() -> bool

View file

@ -59,7 +59,7 @@ class Session():
Converts the name to a mentionable format.
"""
return "".join(c for c in self.name if not c in ",.!?;&<'\"" and not c.isspace())
return "".join(c for c in self.name if not c in ",.!?;&<'\"" and not c.isspace()).lower()
def listable(self, width):
"""