From 8b553d5770f32143ab71fc06f3befab169fa54d0 Mon Sep 17 00:00:00 2001 From: LX Date: Tue, 18 Apr 2023 23:10:09 +0100 Subject: Update filtering.py to ignore edits by bots #2549 --- bot/exts/filtering/filtering.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/exts/filtering/filtering.py b/bot/exts/filtering/filtering.py index aa53cab26..9fb7605d6 100644 --- a/bot/exts/filtering/filtering.py +++ b/bot/exts/filtering/filtering.py @@ -233,6 +233,9 @@ class Filtering(Cog): @Cog.listener() async def on_message_edit(self, before: discord.Message, after: discord.Message) -> None: """Filter the contents of an edited message. Don't reinvoke filters already invoked on the `before` version.""" + if before.author.bot or before.webhook_id or before.type == MessageType.auto_moderation_action: + return + # Only check changes to the message contents/attachments and embed additions, not pin status etc. if all(( before.content == after.content, # content hasn't changed -- cgit v1.2.3