mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 17:36:15 +00:00
Add support for integration_type in audit logs
Currently unsure whether more processing is meant to be done with this, but for now an Optional[str] is the best I can do without more data.
This commit is contained in:
@ -528,6 +528,10 @@ class _AuditLogProxyAutoModAction(_AuditLogProxy):
|
||||
channel: Optional[Union[abc.GuildChannel, Thread]]
|
||||
|
||||
|
||||
class _AuditLogProxyMemberKickOrMemberRoleUpdate(_AuditLogProxy):
|
||||
integration_type: Optional[str]
|
||||
|
||||
|
||||
class AuditLogEntry(Hashable):
|
||||
r"""Represents an Audit Log entry.
|
||||
|
||||
@ -614,6 +618,7 @@ class AuditLogEntry(Hashable):
|
||||
_AuditLogProxyStageInstanceAction,
|
||||
_AuditLogProxyMessageBulkDelete,
|
||||
_AuditLogProxyAutoModAction,
|
||||
_AuditLogProxyMemberKickOrMemberRoleUpdate,
|
||||
Member, User, None, PartialIntegration,
|
||||
Role, Object
|
||||
] = None
|
||||
@ -638,6 +643,10 @@ class AuditLogEntry(Hashable):
|
||||
elif self.action is enums.AuditLogAction.message_bulk_delete:
|
||||
# The bulk message delete action has the number of messages deleted
|
||||
self.extra = _AuditLogProxyMessageBulkDelete(count=int(extra['count']))
|
||||
elif self.action in (enums.AuditLogAction.kick, enums.AuditLogAction.member_role_update):
|
||||
# The member kick action has a dict with some information
|
||||
integration_type = extra.get('integration_type')
|
||||
self.extra = _AuditLogProxyMemberKickOrMemberRoleUpdate(integration_type=integration_type)
|
||||
elif self.action.name.endswith('pin'):
|
||||
# the pin actions have a dict with some information
|
||||
channel_id = int(extra['channel_id'])
|
||||
|
Reference in New Issue
Block a user