Browse Source

Update type hints in AuditLogEntry.user and AuditLogEntry.user_id

pull/9171/head
Rapptz 2 years ago
parent
commit
d11c42c2e6
  1. 6
      discord/audit_logs.py

6
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')

Loading…
Cancel
Save