Skip to content

Commit

Permalink
Fix issue with author changing type
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
megamit committed Sep 2, 2015
1 parent e60777e commit 6a40a5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6a40a5d

Please sign in to comment.