diff --git a/cogs/warden/cog.py b/cogs/warden/cog.py index 3dccd4ac..0310ef1c 100644 --- a/cogs/warden/cog.py +++ b/cogs/warden/cog.py @@ -36,10 +36,12 @@ def __init__(self, bot: Rubbergod): self.message_channel = None def doCheckRepost(self, message: disnake.Message): + has_attachments = len(message.attachments) > 0 or any( + len(snapshot.attachments) > 0 for snapshot in (message.message_snapshots or []) + ) return ( message.channel.id in self.config.deduplication_channels - and message.attachments is not None - and len(message.attachments) > 0 + and has_attachments and not message.author.bot ) diff --git a/cogs/warden/features.py b/cogs/warden/features.py index d6665cdf..5f2ab4fe 100644 --- a/cogs/warden/features.py +++ b/cogs/warden/features.py @@ -8,7 +8,10 @@ async def saveMessageHashes(message: disnake.Message): - for f in message.attachments: + attachments = list(message.attachments) + for snapshot in message.message_snapshots or []: + attachments.extend(snapshot.attachments) + for f in attachments: fp = BytesIO() await f.save(fp) try: