|
@ -277,7 +277,9 @@ class BaseUser(_UserTag): |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
def __str__(self) -> str: |
|
|
def __str__(self) -> str: |
|
|
return f'@{self.name}' |
|
|
if self.discriminator == '0': |
|
|
|
|
|
return f'@{self.name}' |
|
|
|
|
|
return f'{self.name}#{self.discriminator}' |
|
|
|
|
|
|
|
|
def __eq__(self, other: object) -> bool: |
|
|
def __eq__(self, other: object) -> bool: |
|
|
return isinstance(other, _UserTag) and other.id == self.id |
|
|
return isinstance(other, _UserTag) and other.id == self.id |
|
@ -609,7 +611,7 @@ class ClientUser(BaseUser): |
|
|
|
|
|
|
|
|
.. describe:: str(x) |
|
|
.. describe:: str(x) |
|
|
|
|
|
|
|
|
Returns the user's name with a ``@``. |
|
|
Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). |
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0 |
|
|
.. versionchanged:: 2.0 |
|
|
:attr:`Locale` is now a :class:`Locale` instead of a Optional[:class:`str`]. |
|
|
:attr:`Locale` is now a :class:`Locale` instead of a Optional[:class:`str`]. |
|
@ -947,7 +949,7 @@ class User(BaseUser, discord.abc.Connectable, discord.abc.Messageable): |
|
|
|
|
|
|
|
|
.. describe:: str(x) |
|
|
.. describe:: str(x) |
|
|
|
|
|
|
|
|
Returns the user's name with a ``@``. |
|
|
Returns the user's handle (e.g. ``@user`` or ``user#discriminator``). |
|
|
|
|
|
|
|
|
Attributes |
|
|
Attributes |
|
|
----------- |
|
|
----------- |
|
|