Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bot/exts/utils/attachment_pastebin_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ async def on_message_delete(self, message: discord.Message) -> None:
@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}")
Expand Down