diff --git a/yaboli/message.py b/yaboli/message.py index dc96e58..7e64bc5 100644 --- a/yaboli/message.py +++ b/yaboli/message.py @@ -71,15 +71,6 @@ 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 self.sender.mentionable() - def is_edited(self): """ is_edited() -> bool diff --git a/yaboli/room.py b/yaboli/room.py index d2d2f74..ef58f8e 100644 --- a/yaboli/room.py +++ b/yaboli/room.py @@ -257,14 +257,18 @@ class Room(): self._con.add_next_callback(self._handle_nick_reply) self._con.send_packet("nick", name=nick) - def mentionable(self): + def mentionable(self, name=None): """ mentionable() - A mentionable version of the current nick. + A mentionable version of the name. + The name defaults to the bot's name. """ - return "".join(c for c in self.nick if not c in ",.!?;&<'\"" and not c.isspace()).lower() + if name is None: + name = self.nick + + return "".join(c for c in name if not c in ".!?;&<'\"" and not c.isspace()) def send_message(self, content, parent=None): """ diff --git a/yaboli/session.py b/yaboli/session.py index 177a379..e649655 100644 --- a/yaboli/session.py +++ b/yaboli/session.py @@ -52,15 +52,6 @@ class Session(): return self.id.split(":")[0] - 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_staff(self): """ is_staff() -> bool