From ead18e3948fa3be5a5844a298a24268fffaaa597 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 5 Mar 2017 07:48:15 -0500 Subject: [PATCH] Fix issue with members not copying correctly. --- discord/member.py | 6 ++++++ discord/state.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/discord/member.py b/discord/member.py index 60fcf285e..d830462e5 100644 --- a/discord/member.py +++ b/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 diff --git a/discord/state.py b/discord/state.py index 784c6bc43..318a7f378 100644 --- a/discord/state.py +++ b/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)