From 400da9c053f85079b6040a5a31aa004685a124e9 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 23 May 2016 16:32:45 +0200 Subject: [PATCH] Add mentionable function to room --- yaboli/room.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yaboli/room.py b/yaboli/room.py index fc3a6e2..f657728 100644 --- a/yaboli/room.py +++ b/yaboli/room.py @@ -248,6 +248,15 @@ class Room(): self._con.add_next_callback(self._handle_nick_reply) self._con.send_packet("nick", name=nick) + def mentionable(self): + """ + mentionable() + + A mentionable version of the current nick. + """ + + return "".join(c for c in self.nick if not c in ",.!?;&<'\"" and not c.isspace()).lower() + def send_message(self, content, parent=None): """ send_message(content, parent) -> None