diff --git a/interactions/models/discord/auto_mod.py b/interactions/models/discord/auto_mod.py index 9886d93f6..c9be2d142 100644 --- a/interactions/models/discord/auto_mod.py +++ b/interactions/models/discord/auto_mod.py @@ -121,7 +121,6 @@ class HarmfulLinkFilter(BaseTrigger): repr=True, metadata=docs("The type of trigger"), ) - ... @attrs.define(eq=False, order=False, hash=False, kw_only=True) @@ -151,12 +150,24 @@ class MentionSpamTrigger(BaseTrigger): ) +@attrs.define(eq=False, order=False, hash=False, kw_only=True) +class MemberProfileTrigger(BaseTrigger): + regex_patterns: list[str] = attrs.field( + factory=list, repr=True, metadata=docs("The regex patterns to check against") + ) + keyword_filter: str | list[str] = attrs.field( + factory=list, repr=True, metadata=docs("The keywords to check against") + ) + allow_list: list["Snowflake_Type"] = attrs.field( + factory=list, repr=True, metadata=docs("The roles exempt from this rule") + ) + + @attrs.define(eq=False, order=False, hash=False, kw_only=True) class BlockMessage(BaseAction): """blocks the content of a message according to the rule""" type: AutoModAction = attrs.field(repr=False, default=AutoModAction.BLOCK_MESSAGE, converter=AutoModAction) - ... @attrs.define(eq=False, order=False, hash=False, kw_only=True) @@ -175,6 +186,13 @@ class TimeoutUser(BaseAction): type: AutoModAction = attrs.field(repr=False, default=AutoModAction.TIMEOUT_USER, converter=AutoModAction) +@attrs.define(eq=False, order=False, hash=False, kw_only=False) +class BlockMemberInteraction(BaseAction): + """Block a member from using text, voice, or other interactions""" + + # this action has no metadata + + @attrs.define(eq=False, order=False, hash=False, kw_only=True) class AutoModRule(DiscordObject): """A representation of an auto mod rule""" @@ -345,6 +363,7 @@ def member(self) -> "Optional[Member]": AutoModAction.BLOCK_MESSAGE: BlockMessage, AutoModAction.ALERT_MESSAGE: AlertMessage, AutoModAction.TIMEOUT_USER: TimeoutUser, + AutoModAction.BLOCK_MEMBER_INTERACTION: BlockMemberInteraction, } TRIGGER_MAPPING = { @@ -352,4 +371,5 @@ def member(self) -> "Optional[Member]": AutoModTriggerType.HARMFUL_LINK: HarmfulLinkFilter, AutoModTriggerType.KEYWORD_PRESET: KeywordPresetTrigger, AutoModTriggerType.MENTION_SPAM: MentionSpamTrigger, + AutoModTriggerType.MEMBER_PROFILE: MemberProfileTrigger, } diff --git a/interactions/models/discord/enums.py b/interactions/models/discord/enums.py index d4d47a2e9..9cc5cd8d1 100644 --- a/interactions/models/discord/enums.py +++ b/interactions/models/discord/enums.py @@ -974,16 +974,19 @@ class AutoModTriggerType(CursedIntEnum): SPAM = 3 KEYWORD_PRESET = 4 MENTION_SPAM = 5 + MEMBER_PROFILE = 6 class AutoModAction(CursedIntEnum): BLOCK_MESSAGE = 1 ALERT_MESSAGE = 2 TIMEOUT_USER = 3 + BLOCK_MEMBER_INTERACTION = 4 class AutoModEvent(CursedIntEnum): MESSAGE_SEND = 1 + MEMBER_UPDATE = 2 class AutoModLanuguageType(Enum):