From a88bf31af20b4a26a36fcd03462679fa067ae28a Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 23 Apr 2022 03:00:46 -0400 Subject: [PATCH] Sync abc.User protocol with more shared methods This isn't *all* of them but it's a sizeable portion --- discord/abc.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/discord/abc.py b/discord/abc.py index 96bfaafe8..a9d420e4f 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -313,7 +313,7 @@ class User(Snowflake, Protocol): bot: :class:`bool` If the user is a bot account. system: :class:`bool` - If the user is a system user (i.e. represents Discord officially). + If the user is a system account. """ __slots__ = () @@ -338,6 +338,36 @@ class User(Snowflake, Protocol): """Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present.""" raise NotImplementedError + @property + def default_avatar(self) -> Asset: + """:class:`~discord.Asset`: Returns the default avatar for a given user. This is calculated by the user's discriminator.""" + raise NotImplementedError + + @property + def display_avatar(self) -> Asset: + """:class:`~discord.Asset`: Returns the user's display avatar. + + For regular users this is just their default avatar or uploaded avatar. + + .. versionadded:: 2.0 + """ + raise NotImplementedError + + def mentioned_in(self, message: Message) -> bool: + """Checks if the user is mentioned in the specified message. + + Parameters + ----------- + message: :class:`~discord.Message` + The message to check if you're mentioned in. + + Returns + ------- + :class:`bool` + Indicates if the user is mentioned in the message. + """ + raise NotImplementedError + @runtime_checkable class PrivateChannel(Snowflake, Protocol):