From 6a40a5da2ebc978e504625fff1d6befda906649f Mon Sep 17 00:00:00 2001 From: megamit Date: Wed, 2 Sep 2015 23:07:36 +0100 Subject: [PATCH] Fix issue with author changing type When cycling through the attributes of the data json 'author' within 'message' which was previously a user object is overwritten with a dictionary. This causes an AttributeError to be thrown ( and silently swallowed... thanks except: pass) whenever any of its attributes are referenced in the form message.author.x. User data should change in this step and the user object should not be modified for any reason so its safe to skip updating it. --- discord/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/client.py b/discord/client.py index 7d9812e6b952..89aacc09d869 100644 --- a/discord/client.py +++ b/discord/client.py @@ -244,7 +244,7 @@ def _received_message(self, msg): message = copy.deepcopy(older_message) # update the new update for attr in data: - if attr == 'channel_id': + if attr == 'channel_id' or attr == 'author': continue value = data[attr] if 'time' in attr: