Browse Source

Add Role.mentionable attribute.

pull/195/head
Rapptz 9 years ago
parent
commit
196e9463f5
  1. 5
      discord/role.py

5
discord/role.py

@ -63,10 +63,12 @@ class Role(Hashable):
managed : bool managed : bool
Indicates if the role is managed by the server through some form of Indicates if the role is managed by the server through some form of
integrations such as Twitch. integrations such as Twitch.
mentionable : bool
Indicates if the role can be mentioned by users.
""" """
__slots__ = ['id', 'name', 'permissions', 'color', 'colour', 'position', __slots__ = ['id', 'name', 'permissions', 'color', 'colour', 'position',
'managed', '_is_everyone', 'hoist' ] 'managed', 'mentionable', '_is_everyone', 'hoist' ]
def __init__(self, **kwargs): def __init__(self, **kwargs):
self._is_everyone = kwargs.get('everyone', False) self._is_everyone = kwargs.get('everyone', False)
@ -83,6 +85,7 @@ class Role(Hashable):
self.colour = Colour(kwargs.get('color', 0)) self.colour = Colour(kwargs.get('color', 0))
self.hoist = kwargs.get('hoist', False) self.hoist = kwargs.get('hoist', False)
self.managed = kwargs.get('managed', False) self.managed = kwargs.get('managed', False)
self.mentionable = kwargs.get('mentionable', False)
self.color = self.colour self.color = self.colour
if 'everyone' in kwargs: if 'everyone' in kwargs:
self._is_everyone = kwargs['everyone'] self._is_everyone = kwargs['everyone']

Loading…
Cancel
Save