diff --git a/src/domain/message.py b/src/domain/message.py index ac0c686..7545e82 100644 --- a/src/domain/message.py +++ b/src/domain/message.py @@ -58,6 +58,9 @@ class Message(AbstractEntity): """ return random.randint(0, 100) < self.chance + def is_mentioned(self): + return self.text.lower().startswith(config['bot']['mention_name']) or self.text.lower().startswith(config['bot']['mention_name_full']) + def should_answer(self): """ Returns True if bot should answer to this message @@ -66,4 +69,4 @@ class Message(AbstractEntity): return self.has_anchors() \ or self.is_private() \ or self.is_reply_to_bot() \ - or self.is_random_answer() + or self.is_random_answer() or self.is_mentioned()