diff options
author | 2023-04-20 17:43:45 +0100 | |
---|---|---|
committer | 2023-04-20 17:43:45 +0100 | |
commit | 604805b4e61c627764acca53d855ce41d0765dc9 (patch) | |
tree | d1911cd9d71430e44698c42c36d56db3ff60f009 | |
parent | Refine the invite code before filtering it (#2522) (diff) | |
parent | Update filtering.py to remove trailing whitespace (diff) |
Merge pull request #2550 from python-discord/filtering-ignore-bot-edits-fix
Update filtering.py to ignore edits by bots
-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..52401f0c3 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 |