From aaab2b9bbfc1823b5de46ed78b3bfdcc0a382028 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 23 May 2016 02:46:36 +0200 Subject: [PATCH] Get mentionable nick --- yaboli/message.py | 9 +++++++++ yaboli/session.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/yaboli/message.py b/yaboli/message.py index 7e64bc5..7cca765 100644 --- a/yaboli/message.py +++ b/yaboli/message.py @@ -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 diff --git a/yaboli/session.py b/yaboli/session.py index 1d62984..e77a56d 100644 --- a/yaboli/session.py +++ b/yaboli/session.py @@ -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): """