Fix abc.User protocol requirements

This commit is contained in:
Alex Nørgaard 2022-03-07 07:15:46 +00:00 committed by GitHub
parent 0330282c5f
commit 7ff6850f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,8 +145,6 @@ class User(Snowflake, Protocol):
The user's username.
discriminator: :class:`str`
The user's discriminator.
avatar: :class:`~discord.Asset`
The avatar asset the user has.
bot: :class:`bool`
If the user is a bot account.
"""
@ -155,7 +153,6 @@ class User(Snowflake, Protocol):
name: str
discriminator: str
avatar: Asset
bot: bool
@property
@ -168,6 +165,11 @@ class User(Snowflake, Protocol):
""":class:`str`: Returns a string that allows you to mention the given user."""
raise NotImplementedError
@property
def avatar(self) -> Optional[Asset]:
"""Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present."""
raise NotImplementedError
@runtime_checkable
class PrivateChannel(Snowflake, Protocol):