aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-09-28 10:50:10 +0200
committerGravatar Leon Sandøy <[email protected]>2018-09-28 10:50:10 +0200
commit2fb59ded77fe703366eac01dcffd1ebf12266f22 (patch)
treeff8055e570ec2480b8dfe8a097ec351ba4066549
parentsuperficial fix for no role updates caused by changes in the d.py api, plus m... (diff)
Ignore all DMs in the antispam cog
Diffstat (limited to '')
-rw-r--r--bot/cogs/antispam.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/cogs/antispam.py b/bot/cogs/antispam.py
index 7a33ba9e8..d5b72718c 100644
--- a/bot/cogs/antispam.py
+++ b/bot/cogs/antispam.py
@@ -56,7 +56,8 @@ class AntiSpam:
async def on_message(self, message: Message):
if (
- message.guild.id != GuildConfig.id
+ not message.guild
+ or message.guild.id != GuildConfig.id
or message.author.bot
or (message.channel.id in WHITELISTED_CHANNELS and not DEBUG_MODE)
or (message.author.top_role.id in WHITELISTED_ROLES and not DEBUG_MODE)