From ee73cd1fcf0c6937a997762321d732b2ba0fb370 Mon Sep 17 00:00:00 2001 From: hypergonial <46067571+hypergonial@users.noreply.github.com> Date: Sat, 16 Dec 2023 15:44:41 +0100 Subject: [PATCH] Disable certain automod checks on edit --- extensions/automod.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/extensions/automod.py b/extensions/automod.py index 6731835..fc0dade 100644 --- a/extensions/automod.py +++ b/extensions/automod.py @@ -632,18 +632,29 @@ async def scan_messages( policies = await get_policies(message.guild_id) - all( - ( - await detect_mass_mentions(message, policies), - await detect_spam(message, policies), - await detect_attach_spam(message, policies), - await detect_bad_words(message, policies), - await detect_caps(message, policies), - await detect_invites(message, policies), - await detect_link_spam(message, policies), - await detect_perspective(message, policies), + if isinstance(event, hikari.GuildMessageUpdateEvent): + all( + ( + await detect_mass_mentions(message, policies), + await detect_bad_words(message, policies), + await detect_caps(message, policies), + await detect_invites(message, policies), + await detect_perspective(message, policies), + ) + ) + else: + all( + ( + await detect_mass_mentions(message, policies), + await detect_spam(message, policies), + await detect_attach_spam(message, policies), + await detect_bad_words(message, policies), + await detect_caps(message, policies), + await detect_invites(message, policies), + await detect_link_spam(message, policies), + await detect_perspective(message, policies), + ) ) - ) def load(bot: SnedBot) -> None: