diff options
Diffstat (limited to 'helpers.py')
| -rw-r--r-- | helpers.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |