Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/1317.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add :attr:`AuditLogAction.automod_quarantine_user` action type.
1 change: 1 addition & 0 deletions disnake/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ def _from_data(self, data: AuditLogEntryPayload) -> None:
enums.AuditLogAction.automod_block_message,
enums.AuditLogAction.automod_send_alert_message,
enums.AuditLogAction.automod_timeout,
enums.AuditLogAction.automod_quarantine_user,
):
elems = {
"channel": (
Expand Down
4 changes: 3 additions & 1 deletion disnake/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ class AuditLogAction(Enum):
automod_block_message = 143
automod_send_alert_message = 144
automod_timeout = 145
automod_quarantine_user = 146
creator_monetization_request_created = 150
creator_monetization_terms_accepted = 151
# fmt: on
Expand Down Expand Up @@ -822,6 +823,7 @@ def category(self) -> Optional[AuditLogActionCategory]:
AuditLogAction.automod_block_message: None,
AuditLogAction.automod_send_alert_message: None,
AuditLogAction.automod_timeout: None,
AuditLogAction.automod_quarantine_user: None,
AuditLogAction.creator_monetization_request_created: None,
AuditLogAction.creator_monetization_terms_accepted: None,
}
Expand Down Expand Up @@ -867,7 +869,7 @@ def target_type(self) -> Optional[str]:
return None
elif v < 143:
return "automod_rule"
elif v < 146:
elif v < 147:
return "user"
elif v < 152:
return None
Expand Down
1 change: 1 addition & 0 deletions disnake/types/audit_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
143,
144,
145,
146,
150,
151,
]
Expand Down
13 changes: 13 additions & 0 deletions docs/api/audit_logs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,19 @@ AuditLogAction

.. versionadded:: 2.6

.. attribute:: automod_quarantine_user

A member was quarantined by auto moderation.

When this is the action, the type of :attr:`~AuditLogEntry.target` is
the :class:`Member` or :class:`User` who was quarantined.
If the user is not found then it is a :class:`Object` with the user's ID.

See :attr:`automod_block_message` for more information on how the
:attr:`~AuditLogEntry.extra` field is set.

.. versionadded:: 2.11

.. attribute:: creator_monetization_request_created

A creator monetization request was created.
Expand Down
Loading