From 3410849543ee60ff7a57ddfa0ff975f0ce308747 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 25 Apr 2017 06:55:18 -0700 Subject: [PATCH] Fix cases where member presence can be stomped on --- disco/state.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/disco/state.py b/disco/state.py index f914b29..848665b 100644 --- a/disco/state.py +++ b/disco/state.py @@ -184,7 +184,8 @@ class State(object): self.channels.update(event.guild.channels) for member in six.itervalues(event.guild.members): - self.users[member.user.id] = member.user + if member.user.id not in self.users: + self.users[member.user.id] = member.user for presence in event.presences: self.users[presence.user.id].presence = presence @@ -285,7 +286,8 @@ class State(object): for member in event.members: member.guild_id = guild.id guild.members[member.id] = member - self.users[member.id] = member.user + if member.id not in self.users: + self.users[member.id] = member.user def on_guild_role_create(self, event): if event.guild_id not in self.guilds: