diff options
| -rw-r--r-- | bot/cogs/antimalware.py | 3 |
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 |