mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-31 05:23:03 +00:00 
			
		
		
		
	Add User.bot attribute to check if a user is a bot account.
This commit is contained in:
		| @@ -54,15 +54,18 @@ class User: | ||||
|         The user's discriminator. This is given when the username has conflicts. | ||||
|     avatar : str | ||||
|         The avatar hash the user has. Could be None. | ||||
|     bot : bool | ||||
|         Specifies if the user is a bot account. | ||||
|     """ | ||||
|  | ||||
|     __slots__ = ['name', 'id', 'discriminator', 'avatar'] | ||||
|     __slots__ = ['name', 'id', 'discriminator', 'avatar', 'bot'] | ||||
|  | ||||
|     def __init__(self, **kwargs): | ||||
|         self.name = kwargs.get('username') | ||||
|         self.id = kwargs.get('id') | ||||
|         self.discriminator = kwargs.get('discriminator') | ||||
|         self.avatar = kwargs.get('avatar') | ||||
|         self.bot = kwargs.get('bot', False) | ||||
|  | ||||
|     def __str__(self): | ||||
|         return '{0.name}#{0.discriminator}'.format(self) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user