Browse Source

Check if the server is valid during GUILD_MEMBER_REMOVE.

pull/24/head
Rapptz 10 years ago
parent
commit
4ec052a35c
  1. 9
      discord/client.py

9
discord/client.py

@ -276,10 +276,11 @@ class ConnectionState(object):
def handle_guild_member_remove(self, data):
server = self._get_server(data.get('guild_id'))
user_id = data['user']['id']
member = utils.find(lambda m: m.id == user_id, server.members)
server.members.remove(member)
self.dispatch('member_remove', member)
if server is not None:
user_id = data['user']['id']
member = utils.find(lambda m: m.id == user_id, server.members)
server.members.remove(member)
self.dispatch('member_remove', member)
def handle_guild_member_update(self, data):
server = self._get_server(data.get('guild_id'))

Loading…
Cancel
Save