diff options
author | 2021-01-20 16:38:58 +0000 | |
---|---|---|
committer | 2021-01-20 16:38:58 +0000 | |
commit | eccbebf8f29998dcee72b690ed405221363a984f (patch) | |
tree | c074f86386dcf0209a238b754dd6da76a1521886 | |
parent | Merge 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.py | 4 |
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: |