diff options
| author | 2020-07-12 15:39:40 +0200 | |
|---|---|---|
| committer | 2020-07-12 15:39:40 +0200 | |
| commit | 4349fdedaae43f35f9821aa61c91a1e76908b0b5 (patch) | |
| tree | 4cd83750a231bf6df2541cb07a300c70d8a0f181 | |
| parent | Replace channel ID with webhook ID for dm_log. (diff) | |
Only relay DMs, and only from humans.
https://github.com/python-discord/bot/issues/667
| -rw-r--r-- | bot/cogs/dm_relay.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/dm_relay.py b/bot/cogs/dm_relay.py index 32ac0e4ee..bb060fe90 100644 --- a/bot/cogs/dm_relay.py +++ b/bot/cogs/dm_relay.py @@ -33,6 +33,10 @@ class DMRelay(Cog): @Cog.listener() async def on_message(self, message: discord.Message) -> None: """Relays the message's content and attachments to the dm_log channel.""" + # Only relay DMs from humans + if message.author.bot or message.guild: + return + clean_content = message.clean_content if clean_content: await send_webhook( |