mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-25 10:32:59 +00:00 
			
		
		
		
	User.__str__ now includes the discriminator.
This commit is contained in:
		| @@ -32,17 +32,17 @@ class User: | |||||||
|  |  | ||||||
|     Supported Operations: |     Supported Operations: | ||||||
|  |  | ||||||
|     +-----------+------------------------------------+ |     +-----------+---------------------------------------------+ | ||||||
|     | Operation |            Description             | |     | Operation |                 Description                 | | ||||||
|     +===========+====================================+ |     +===========+=============================================+ | ||||||
|     | x == y    | Checks if two users are equal.     | |     | x == y    | Checks if two users are equal.              | | ||||||
|     +-----------+------------------------------------+ |     +-----------+---------------------------------------------+ | ||||||
|     | x != y    | Checks if two users are not equal. | |     | x != y    | Checks if two users are not equal.          | | ||||||
|     +-----------+------------------------------------+ |     +-----------+---------------------------------------------+ | ||||||
|     | hash(x)   | Return the user's hash.            | |     | hash(x)   | Return the user's hash.                     | | ||||||
|     +-----------+------------------------------------+ |     +-----------+---------------------------------------------+ | ||||||
|     | str(x)    | Returns the user's name.           | |     | str(x)    | Returns the user's name with discriminator. | | ||||||
|     +-----------+------------------------------------+ |     +-----------+---------------------------------------------+ | ||||||
|  |  | ||||||
|     Attributes |     Attributes | ||||||
|     ----------- |     ----------- | ||||||
| @@ -65,7 +65,7 @@ class User: | |||||||
|         self.avatar = kwargs.get('avatar') |         self.avatar = kwargs.get('avatar') | ||||||
|  |  | ||||||
|     def __str__(self): |     def __str__(self): | ||||||
|         return self.name |         return '{0.name}#{0.discriminator}'.format(self) | ||||||
|  |  | ||||||
|     def __eq__(self, other): |     def __eq__(self, other): | ||||||
|         return isinstance(other, User) and other.id == self.id |         return isinstance(other, User) and other.id == self.id | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user