aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar wookie184 <[email protected]>2021-08-23 17:54:57 +0100
committerGravatar wookie184 <[email protected]>2021-08-23 17:54:57 +0100
commit0199600317ceba0784c3d6c23627f8d8b84649af (patch)
tree2623aee626c00973121482dcb2a9754d41646809
parentUpdate reminders command to use `UserMentionOrID` instead of `discord.Member`... (diff)
Ignore bot mentions in antispam mentions rule
-rw-r--r--bot/rules/mentions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/rules/mentions.py b/bot/rules/mentions.py
index 79725a4b1..6f5addad1 100644
--- a/bot/rules/mentions.py
+++ b/bot/rules/mentions.py
@@ -13,7 +13,11 @@ async def apply(
if msg.author == last_message.author
)
- total_recent_mentions = sum(len(msg.mentions) for msg in relevant_messages)
+ total_recent_mentions = sum(
+ not user.bot
+ for msg in relevant_messages
+ for user in msg.mentions
+ )
if total_recent_mentions > config['max']:
return (