da bot name da
This commit is contained in:
1 parent
9e34970cf6
commit
dac0a6569c
1 file changed
+8
@@ -33,12 +33,20 @@ def is_replied_bot(message, is_channel, user_text, config=None):
|
|||||||
mentions_bot = any(
|
mentions_bot = any(
|
||||||
user_text.lower().startswith(call.lower()) for call in BOT_CALLS
|
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:
|
else:
|
||||||
mentions_bot = False
|
mentions_bot = False
|
||||||
else:
|
else:
|
||||||
mentions_bot = any(
|
mentions_bot = any(
|
||||||
user_text.lower().startswith(call.lower()) for call in BOT_CALLS
|
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):
|
if not (is_reply_to_bot or mentions_bot):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in new issue
Block a user