diff --git a/helpers.py b/helpers.py index f4ea3cd..4204870 100644 --- a/helpers.py +++ b/helpers.py @@ -33,12 +33,20 @@ def is_replied_bot(message, is_channel, user_text, config=None): mentions_bot = any( user_text.lower().startswith(call.lower()) for call in BOT_CALLS ) + for call in BOT_CALLS: + if call.startswith("@"): + if call.lower() in user_text.lower(): + mentions_bot = True else: mentions_bot = False else: mentions_bot = any( user_text.lower().startswith(call.lower()) for call in BOT_CALLS ) + for call in BOT_CALLS: + if call.startswith("@"): + if call.lower() in user_text.lower(): + mentions_bot = True if not (is_reply_to_bot or mentions_bot): return False return True