diff options
author | 2025-10-21 13:29:11 -0400 | |
---|---|---|
committer | 2025-10-21 18:29:11 +0100 | |
commit | 88574889cfa180524b2a6a9c7100a780590a53f1 (patch) | |
tree | f944e6378f7b6c39eec53cb27173c3821ddfb991 | |
parent | Dependency bumps (including pydis_core to 11.8.0) (diff) |
fix: don't upload attachments in dms (#3412)
* fix: don't upload attachments in dms
closes GH-3403
-rw-r--r-- | bot/exts/utils/attachment_pastebin_uploader.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/utils/attachment_pastebin_uploader.py b/bot/exts/utils/attachment_pastebin_uploader.py index 9a805dd66..1ea74b509 100644 --- a/bot/exts/utils/attachment_pastebin_uploader.py +++ b/bot/exts/utils/attachment_pastebin_uploader.py @@ -77,8 +77,8 @@ class AutoTextAttachmentUploader(commands.Cog): @commands.Cog.listener() async def on_message(self, message: discord.Message) -> None: """Listens for messages containing attachments and offers to upload them to the pastebin.""" - # Check if the message contains an embedded file and is not sent by a bot. - if message.author.bot or not any("charset" in a.content_type for a in message.attachments): + # Check if the message contains an embedded file and is not sent by a bot or in DMs. + if message.author.bot or not message.guild or not any("charset" in a.content_type for a in message.attachments): return log.trace(f"Offering to upload attachments for {message.author} in {message.channel}, message {message.id}") |