aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks123 <[email protected]>2020-02-26 19:34:01 +0200
committerGravatar ks123 <[email protected]>2020-02-26 19:34:01 +0200
commitb628c5b9a054af22851aa099f0656ed465472456 (patch)
tree53607a7eb3737ab75a2686dc29b1fd58a696840a
parentAdded to AntiMalware staff ignore check. (diff)
Added DMs ignoring to antimalware check
-rw-r--r--bot/cogs/antimalware.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/antimalware.py b/bot/cogs/antimalware.py
index d2ff9f79c..957c458c0 100644
--- a/bot/cogs/antimalware.py
+++ b/bot/cogs/antimalware.py
@@ -18,7 +18,8 @@ class AntiMalware(Cog):
@Cog.listener()
async def on_message(self, message: Message) -> None:
"""Identify messages with prohibited attachments."""
- if not message.attachments:
+ # Return when message don't have attachment and don't moderate DMs
+ if not message.attachments or not message.guild:
return
# Check if user is staff, if is, return