aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joseph Banks <[email protected]>2020-06-10 02:35:48 +0100
committerGravatar GitHub <[email protected]>2020-06-10 02:35:48 +0100
commit25ad6df853a019ef4d29e3ff0bad2412012b9072 (patch)
treedd3ddc076c408290f0aa5f7d138f416a22017771
parentAdd Python Atlanta to guild whitelists (diff)
parentMerge branch 'master' into bug/mod/932/modlog-ignore-dms (diff)
Merge pull request #935 from python-discord/bug/mod/932/modlog-ignore-dms
ModLog: ignore DMs in the message delete listener
-rw-r--r--bot/cogs/moderation/modlog.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index 9d28030d9..41472c64c 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -555,6 +555,10 @@ class ModLog(Cog, name="ModLog"):
channel = message.channel
author = message.author
+ # Ignore DMs.
+ if not message.guild:
+ return
+
if message.guild.id != GuildConstant.id or channel.id in GuildConstant.modlog_blacklist:
return