aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-01-20 16:38:58 +0000
committerGravatar Joe Banks <[email protected]>2021-01-20 16:38:58 +0000
commiteccbebf8f29998dcee72b690ed405221363a984f (patch)
treec074f86386dcf0209a238b754dd6da76a1521886
parentMerge pull request #1188 from ks129/help-disabled-command (diff)
Prevent bot from sending DMs to itself
Fixes BOT-KX
-rw-r--r--bot/exts/moderation/dm_relay.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/moderation/dm_relay.py b/bot/exts/moderation/dm_relay.py
index 4d5142b55..6d081741c 100644
--- a/bot/exts/moderation/dm_relay.py
+++ b/bot/exts/moderation/dm_relay.py
@@ -52,6 +52,10 @@ class DMRelay(Cog):
await ctx.message.add_reaction("❌")
return
+ if member.id == self.bot.user.id:
+ log.debug("Not sending message to bot user")
+ return await ctx.send("🚫 I can't send messages to myself!")
+
try:
await member.send(message)
except discord.errors.Forbidden: