|
@ -161,7 +161,8 @@ class Member(discord.abc.Messageable, _BaseUser): |
|
|
Nitro boost on the guild, if available. This could be ``None``. |
|
|
Nitro boost on the guild, if available. This could be ``None``. |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
__slots__ = ('_roles', 'joined_at', 'premium_since', '_client_status', 'activities', 'guild', 'nick', '_user', '_state') |
|
|
__slots__ = ('_roles', '_cs_roles', 'joined_at', 'premium_since', '_client_status', |
|
|
|
|
|
'activities', 'guild', 'nick', '_user', '_state') |
|
|
|
|
|
|
|
|
def __init__(self, *, data, guild, state): |
|
|
def __init__(self, *, data, guild, state): |
|
|
self._state = state |
|
|
self._state = state |
|
@ -233,6 +234,11 @@ class Member(discord.abc.Messageable, _BaseUser): |
|
|
self.activities = member.activities |
|
|
self.activities = member.activities |
|
|
self._state = member._state |
|
|
self._state = member._state |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
del self._cs_roles |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
# Reference will not be copied unless necessary by PRESENCE_UPDATE |
|
|
# Reference will not be copied unless necessary by PRESENCE_UPDATE |
|
|
# See below |
|
|
# See below |
|
|
self._user = member._user |
|
|
self._user = member._user |
|
@ -244,6 +250,10 @@ class Member(discord.abc.Messageable, _BaseUser): |
|
|
|
|
|
|
|
|
def _update_roles(self, data): |
|
|
def _update_roles(self, data): |
|
|
self._roles = utils.SnowflakeList(map(int, data['roles'])) |
|
|
self._roles = utils.SnowflakeList(map(int, data['roles'])) |
|
|
|
|
|
try: |
|
|
|
|
|
del self._cs_roles |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
def _update(self, data): |
|
|
def _update(self, data): |
|
|
# the nickname change is optional, |
|
|
# the nickname change is optional, |
|
@ -334,7 +344,7 @@ class Member(discord.abc.Messageable, _BaseUser): |
|
|
""" |
|
|
""" |
|
|
return self.colour |
|
|
return self.colour |
|
|
|
|
|
|
|
|
@property |
|
|
@utils.cached_slot_property('_cs_roles') |
|
|
def roles(self): |
|
|
def roles(self): |
|
|
"""List[:class:`Role`]: A :class:`list` of :class:`Role` that the member belongs to. Note |
|
|
"""List[:class:`Role`]: A :class:`list` of :class:`Role` that the member belongs to. Note |
|
|
that the first element of this list is always the default '@everyone' |
|
|
that the first element of this list is always the default '@everyone' |
|
|