From d11c42c2e6707e87bae7a1057b1f2a74f6d206b6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 12 Jan 2023 18:21:01 -0500 Subject: [PATCH] Update type hints in AuditLogEntry.user and AuditLogEntry.user_id --- discord/audit_logs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 165b4213a..5c375a30c 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -541,10 +541,10 @@ class AuditLogEntry(Hashable): ----------- action: :class:`AuditLogAction` The action that was done. - user: :class:`abc.User` + user: Optional[:class:`abc.User`] The user who initiated this action. Usually a :class:`Member`\, unless gone then it's a :class:`User`. - user_id: :class:`int` + user_id: Optional[:class:`int`] The user ID who initiated this action. .. versionadded:: 2.2 @@ -670,7 +670,7 @@ class AuditLogEntry(Hashable): # into meaningful data when requested self._changes = data.get('changes', []) - self.user_id = utils._get_as_snowflake(data, 'user_id') + self.user_id: Optional[int] = utils._get_as_snowflake(data, 'user_id') self.user: Optional[Union[User, Member]] = self._get_member(self.user_id) self._target_id = utils._get_as_snowflake(data, 'target_id')