aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-04-09 20:28:09 -0400
committerRapptz <[email protected]>2016-04-09 21:42:25 -0400
commitfa14c72836eb066acbca35ec0d68bdabe97dcaf2 (patch)
treefef0a630e206cb4be8d867d3f1412c45b66c94b1
parentFix typo in Role.created_at (diff)
downloaddiscord.py-fa14c72836eb066acbca35ec0d68bdabe97dcaf2.tar.xz
discord.py-fa14c72836eb066acbca35ec0d68bdabe97dcaf2.zip
Add User.bot attribute to check if a user is a bot account.
-rw-r--r--discord/user.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/user.py b/discord/user.py
index ab24edb2..822f7be1 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -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)