diff options
| author | 2020-02-26 19:34:01 +0200 | |
|---|---|---|
| committer | 2020-02-26 19:34:01 +0200 | |
| commit | b628c5b9a054af22851aa099f0656ed465472456 (patch) | |
| tree | 53607a7eb3737ab75a2686dc29b1fd58a696840a | |
| parent | Added to AntiMalware staff ignore check. (diff) | |
Added DMs ignoring to antimalware check
| -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 |