mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-11 14:02:13 +00:00
Add support for automod_quarantined_guild_tag member flag
This commit is contained in:
parent
5f4a822c2e
commit
e715ad6419
@ -614,6 +614,11 @@ 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]
|
||||
|
||||
@ -704,6 +709,7 @@ class AuditLogEntry(Hashable):
|
||||
_AuditLogProxyStageInstanceAction,
|
||||
_AuditLogProxyMessageBulkDelete,
|
||||
_AuditLogProxyAutoModAction,
|
||||
_AuditLogProxyAutoModActionQuarantineUser,
|
||||
_AuditLogProxyMemberKickOrMemberRoleUpdate,
|
||||
Member, User, None, PartialIntegration,
|
||||
Role, Object
|
||||
@ -759,6 +765,13 @@ 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, extra['auto_moderation_rule_trigger_type']
|
||||
),
|
||||
)
|
||||
|
||||
elif self.action.name.startswith('overwrite_'):
|
||||
# the overwrite_ actions have a dict with some information
|
||||
|
@ -398,6 +398,7 @@ class AuditLogAction(Enum):
|
||||
automod_block_message = 143
|
||||
automod_flag_message = 144
|
||||
automod_timeout_member = 145
|
||||
automod_quarantine_user = 146
|
||||
creator_monetization_request_created = 150
|
||||
creator_monetization_terms_accepted = 151
|
||||
# fmt: on
|
||||
@ -460,6 +461,7 @@ class AuditLogAction(Enum):
|
||||
AuditLogAction.automod_block_message: None,
|
||||
AuditLogAction.automod_flag_message: None,
|
||||
AuditLogAction.automod_timeout_member: None,
|
||||
AuditLogAction.automod_quarantine_user: None,
|
||||
AuditLogAction.creator_monetization_request_created: None,
|
||||
AuditLogAction.creator_monetization_terms_accepted: None,
|
||||
AuditLogAction.soundboard_sound_create: AuditLogActionCategory.create,
|
||||
@ -506,7 +508,7 @@ class AuditLogAction(Enum):
|
||||
return 'integration_or_app_command'
|
||||
elif 139 < v < 143:
|
||||
return 'auto_moderation'
|
||||
elif v < 146:
|
||||
elif v < 147:
|
||||
return 'user'
|
||||
elif v < 152:
|
||||
return 'creator_monetization'
|
||||
|
@ -2094,6 +2094,15 @@ class MemberFlags(BaseFlags):
|
||||
"""
|
||||
return 1 << 7
|
||||
|
||||
@flag_value
|
||||
def automod_quarantined_guild_tag(self):
|
||||
""":class:`bool`: Returns ``True`` if the member's guild tag has been
|
||||
blocked by AutoMod.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
"""
|
||||
return 1 << 10
|
||||
|
||||
@flag_value
|
||||
def dm_settings_upsell_acknowledged(self):
|
||||
""":class:`bool`: Returns ``True`` if the member has dismissed the DM settings upsell.
|
||||
|
@ -97,6 +97,7 @@ AuditLogEvent = Literal[
|
||||
143,
|
||||
144,
|
||||
145,
|
||||
146,
|
||||
150,
|
||||
151,
|
||||
]
|
||||
|
17
docs/api.rst
17
docs/api.rst
@ -3055,6 +3055,23 @@ of :class:`enum.Enum`.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
|
||||
.. attribute:: automod_quarantine_user
|
||||
|
||||
An automod rule quarantined a member.
|
||||
|
||||
When this is the action, the type of :attr:`~AuditLogEntry.target` is
|
||||
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:
|
||||
|
||||
- ``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.
|
||||
|
||||
When this is the action, :attr:`AuditLogEntry.changes` is empty.
|
||||
|
||||
.. versionadded:: 2.6
|
||||
|
||||
.. attribute:: creator_monetization_request_created
|
||||
|
||||
A request to monetize the server was created.
|
||||
|
Loading…
x
Reference in New Issue
Block a user