aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar wookie184 <[email protected]>2020-09-01 11:27:29 +0100
committerGravatar wookie184 <[email protected]>2020-09-01 11:27:29 +0100
commit03ab17b9383a57591b2f82a0526188efd902f61b (patch)
tree639950d35d389dfbf8d85cbb50ae1dd69b8b3de4
parentAllow moderators to use defcon (diff)
Added checks to ignore webhook and bot messages
-rw-r--r--bot/cogs/antimalware.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/antimalware.py b/bot/cogs/antimalware.py
index c76bd2c60..7894ec48f 100644
--- a/bot/cogs/antimalware.py
+++ b/bot/cogs/antimalware.py
@@ -55,6 +55,10 @@ class AntiMalware(Cog):
if not message.attachments or not message.guild:
return
+ # Ignore webhook and bot messages
+ if message.webhook_id or message.author.bot:
+ return
+
# Check if user is staff, if is, return
# Since we only care that roles exist to iterate over, check for the attr rather than a User/Member instance
if hasattr(message.author, "roles") and any(role.id in STAFF_ROLES for role in message.author.roles):