Browse Source

Fix audit log bulk message delete not exposing count

pull/8041/head
Rapptz 3 years ago
parent
commit
b7e25645dc
  1. 8
      discord/audit_logs.py

8
discord/audit_logs.py

@ -421,6 +421,10 @@ class _AuditLogProxyStageInstanceAction(_AuditLogProxy):
channel: abc.GuildChannel
class _AuditLogProxyMessageBulkDelete(_AuditLogProxy):
count: int
class AuditLogEntry(Hashable):
r"""Represents an Audit Log entry.
@ -495,6 +499,7 @@ class AuditLogEntry(Hashable):
_AuditLogProxyMemberDisconnect,
_AuditLogProxyPinAction,
_AuditLogProxyStageInstanceAction,
_AuditLogProxyMessageBulkDelete,
Member, User, None, PartialIntegration,
Role, Object
] = None
@ -516,6 +521,9 @@ class AuditLogEntry(Hashable):
elif self.action is enums.AuditLogAction.member_disconnect:
# The member disconnect action has a dict with some information
self.extra = _AuditLogProxyMemberDisconnect(count=int(extra['count']))
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.name.endswith('pin'):
# the pin actions have a dict with some information
channel_id = int(extra['channel_id'])

Loading…
Cancel
Save