aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-04-01 05:48:31 -0400
committerRapptz <[email protected]>2016-04-01 05:48:31 -0400
commitf93fa8a0b2f3f347cd0f435fe7799ea27c2a2f98 (patch)
tree11a685fa36cf3c67877f332282b4b16ea3483606
parentClarify that linux users need libffi for PyNaCl. (diff)
downloaddiscord.py-f93fa8a0b2f3f347cd0f435fe7799ea27c2a2f98.tar.xz
discord.py-f93fa8a0b2f3f347cd0f435fe7799ea27c2a2f98.zip
User.__str__ now includes the discriminator.
-rw-r--r--discord/user.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/discord/user.py b/discord/user.py
index 87bd0397..ab24edb2 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -32,17 +32,17 @@ class User:
Supported Operations:
- +-----------+------------------------------------+
- | Operation | Description |
- +===========+====================================+
- | x == y | Checks if two users are equal. |
- +-----------+------------------------------------+
- | x != y | Checks if two users are not equal. |
- +-----------+------------------------------------+
- | hash(x) | Return the user's hash. |
- +-----------+------------------------------------+
- | str(x) | Returns the user's name. |
- +-----------+------------------------------------+
+ +-----------+---------------------------------------------+
+ | Operation | Description |
+ +===========+=============================================+
+ | x == y | Checks if two users are equal. |
+ +-----------+---------------------------------------------+
+ | x != y | Checks if two users are not equal. |
+ +-----------+---------------------------------------------+
+ | hash(x) | Return the user's hash. |
+ +-----------+---------------------------------------------+
+ | str(x) | Returns the user's name with discriminator. |
+ +-----------+---------------------------------------------+
Attributes
-----------
@@ -65,7 +65,7 @@ class User:
self.avatar = kwargs.get('avatar')
def __str__(self):
- return self.name
+ return '{0.name}#{0.discriminator}'.format(self)
def __eq__(self, other):
return isinstance(other, User) and other.id == self.id