Browse Source

Fix issue with members not copying correctly.

pull/476/merge
Rapptz 8 years ago
parent
commit
ead18e3948
  1. 6
      discord/member.py
  2. 2
      discord/state.py

6
discord/member.py

@ -26,6 +26,7 @@ DEALINGS IN THE SOFTWARE.
import asyncio
import itertools
import copy
import discord.abc
@ -214,6 +215,11 @@ class Member(discord.abc.Messageable):
u.avatar = user.get('avatar', u.avatar)
u.discriminator = user.get('discriminator', u.discriminator)
def _copy(self):
c = copy.copy(self)
c._user = copy.copy(self._user)
return c
@property
def colour(self):
"""A property that returns a :class:`Colour` denoting the rendered colour

2
discord/state.py

@ -356,7 +356,7 @@ class ConnectionState:
member = Member(guild=guild, data=data, state=self)
guild._add_member(member)
old_member = copy.copy(member)
old_member = member._copy()
member._presence_update(data=data, user=user)
self.dispatch('member_update', old_member, member)

Loading…
Cancel
Save