aboutsummaryrefslogtreecommitdiff
path: root/discord/role.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-10-10 20:09:06 -0400
committerRapptz <[email protected]>2017-01-03 09:51:49 -0500
commit45c729b167509deb5e389a7812d0ae8f4cbc4e72 (patch)
tree5617af109edb3d7b7fb0e28934bf57e4f664f362 /discord/role.py
parentRemove Message.timestamp and make Message.channel_mentions lazy. (diff)
downloaddiscord.py-45c729b167509deb5e389a7812d0ae8f4cbc4e72.tar.xz
discord.py-45c729b167509deb5e389a7812d0ae8f4cbc4e72.zip
Switch IDs to use int instead of str
Diffstat (limited to 'discord/role.py')
-rw-r--r--discord/role.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/discord/role.py b/discord/role.py
index eb111d33..daee2c92 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -56,25 +56,25 @@ class Role(Hashable):
Attributes
----------
- id : str
+ id: int
The ID for the role.
- name : str
+ name: str
The name of the role.
- permissions : :class:`Permissions`
+ permissions: :class:`Permissions`
Represents the role's permissions.
- server : :class:`Server`
+ server: :class:`Server`
The server the role belongs to.
- colour : :class:`Colour`
+ colour: :class:`Colour`
Represents the role colour. An alias exists under ``color``.
- hoist : bool
+ hoist: bool
Indicates if the role will be displayed separately from other members.
- position : int
+ position: int
The position of the role. This number is usually positive. The bottom
role has a position of 0.
- managed : bool
+ managed: bool
Indicates if the role is managed by the server through some form of
integrations such as Twitch.
- mentionable : bool
+ mentionable: bool
Indicates if the role can be mentioned by users.
"""
@@ -84,6 +84,7 @@ class Role(Hashable):
def __init__(self, *, server, state, data):
self.server = server
self._state = state
+ self.id = int(data['id'])
self._update(data)
def __str__(self):
@@ -120,7 +121,6 @@ class Role(Hashable):
return not r
def _update(self, data):
- self.id = data['id']
self.name = data['name']
self.permissions = Permissions(data.get('permissions', 0))
self.position = data.get('position', 0)