From baabd309a2542fc95743d8fbf3e861e7382bd45b Mon Sep 17 00:00:00 2001 From: Sacul Date: Thu, 21 Aug 2025 16:40:42 +0800 Subject: [PATCH 1/3] Update audit_logs.py --- discord/audit_logs.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index c27a793c3..8159d669f 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -630,11 +630,6 @@ class _AuditLogProxyAutoModAction(_AuditLogProxy): channel: Optional[Union[abc.GuildChannel, Thread]] -class _AuditLogProxyAutoModActionQuarantineUser(_AuditLogProxy): - automod_rule_name: str - automod_rule_trigger_type: str - - class _AuditLogProxyMemberKickOrMemberRoleUpdate(_AuditLogProxy): integration_type: Optional[str] @@ -766,6 +761,7 @@ class AuditLogEntry(Hashable): self.action is enums.AuditLogAction.automod_block_message or self.action is enums.AuditLogAction.automod_flag_message or self.action is enums.AuditLogAction.automod_timeout_member + or self.action is enums.AuditLogAction.automod_quarantine_user ): channel_id = utils._get_as_snowflake(extra, 'channel_id') channel = None @@ -781,13 +777,6 @@ class AuditLogEntry(Hashable): ), channel=channel, ) - elif self.action is enums.AuditLogAction.automod_quarantine_user: - self.extra = _AuditLogProxyAutoModActionQuarantineUser( - automod_rule_name=extra['auto_moderation_rule_name'], - automod_rule_trigger_type=enums.try_enum( - enums.AutoModRuleTriggerType, int(extra['auto_moderation_rule_trigger_type']) - ), - ) elif self.action.name.startswith('overwrite_'): # the overwrite_ actions have a dict with some information From ffa9fd0344ecf49b6269e577f0e0935f063bf4af Mon Sep 17 00:00:00 2001 From: Sacul Date: Thu, 21 Aug 2025 17:01:58 +0800 Subject: [PATCH 2/3] Update api.rst --- docs/api.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 53ddec06e..c2f7b7bd2 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3063,10 +3063,11 @@ of :class:`enum.Enum`. a :class:`Member` with the ID of the person who triggered the automod rule. When this is the action, the type of :attr:`~AuditLogEntry.extra` is - set to an unspecified proxy object with 2 attributes: + set to an unspecified proxy object with 3 attributes: - ``automod_rule_name``: The name of the automod rule that was triggered. - ``automod_rule_trigger_type``: A :class:`AutoModRuleTriggerType` representation of the rule type that was triggered. + - ``channel``: The channel of the message sent by the member when they were flagged. `None` if the member was quarantined when they just joined the guild. When this is the action, :attr:`AuditLogEntry.changes` is empty. From 4564ffd4a2ab368c72f48ed964de9e35e3e17c9c Mon Sep 17 00:00:00 2001 From: Sacul Date: Thu, 21 Aug 2025 17:15:53 +0800 Subject: [PATCH 3/3] Remove `_AuditLogProxyAutoModActionQuarantineUser` --- discord/audit_logs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 8159d669f..e56f0fb3d 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -720,7 +720,6 @@ class AuditLogEntry(Hashable): _AuditLogProxyStageInstanceAction, _AuditLogProxyMessageBulkDelete, _AuditLogProxyAutoModAction, - _AuditLogProxyAutoModActionQuarantineUser, _AuditLogProxyMemberKickOrMemberRoleUpdate, Member, User, None, PartialIntegration, Role, Object