diff options
author | 2023-04-18 23:10:09 +0100 | |
---|---|---|
committer | 2023-04-18 23:10:09 +0100 | |
commit | 8b553d5770f32143ab71fc06f3befab169fa54d0 (patch) | |
tree | 64089645ed65b3a46ca1796ff712e233293fb256 | |
parent | Refine the invite code before filtering it (#2522) (diff) |
Update filtering.py to ignore edits by bots
#2549
-rw-r--r-- | bot/exts/filtering/filtering.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |