From b7e25645dc68bbb828bf1ede711d098c6b183237 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 14 May 2022 09:36:28 -0400 Subject: [PATCH] Fix audit log bulk message delete not exposing count --- discord/audit_logs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index b744deaf1..22ce607cd 100644 --- a/discord/audit_logs.py +++ b/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'])