aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar wookie184 <[email protected]>2023-04-20 17:43:45 +0100
committerGravatar GitHub <[email protected]>2023-04-20 17:43:45 +0100
commit604805b4e61c627764acca53d855ce41d0765dc9 (patch)
treed1911cd9d71430e44698c42c36d56db3ff60f009
parentRefine the invite code before filtering it (#2522) (diff)
parentUpdate 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.py3
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