mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Sync abc.User protocol with more shared methods
This isn't *all* of them but it's a sizeable portion
This commit is contained in:
parent
f045b7d63c
commit
69b12b97c0
@ -215,6 +215,8 @@ class User(Snowflake, Protocol):
|
|||||||
The user's discriminator.
|
The user's discriminator.
|
||||||
bot: :class:`bool`
|
bot: :class:`bool`
|
||||||
If the user is a bot account.
|
If the user is a bot account.
|
||||||
|
system: :class:`bool`
|
||||||
|
If the user is a system account.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
@ -222,6 +224,7 @@ class User(Snowflake, Protocol):
|
|||||||
name: str
|
name: str
|
||||||
discriminator: str
|
discriminator: str
|
||||||
bot: bool
|
bot: bool
|
||||||
|
system: bool
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def display_name(self) -> str:
|
def display_name(self) -> str:
|
||||||
@ -238,6 +241,36 @@ class User(Snowflake, Protocol):
|
|||||||
"""Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present."""
|
"""Optional[:class:`~discord.Asset`]: Returns an Asset that represents the user's avatar, if present."""
|
||||||
raise NotImplementedError
|
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
|
@runtime_checkable
|
||||||
class PrivateChannel(Snowflake, Protocol):
|
class PrivateChannel(Snowflake, Protocol):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user