Browse Source

Fix stray AttributeError in Guild._from_data with member cache

pull/6701/head
Rapptz 4 years ago
parent
commit
217c2a1cc5
  1. 3
      discord/guild.py

3
discord/guild.py

@ -315,12 +315,11 @@ class Guild(Hashable):
self._rules_channel_id = utils._get_as_snowflake(guild, 'rules_channel_id')
self._public_updates_channel_id = utils._get_as_snowflake(guild, 'public_updates_channel_id')
cache_online_members = self._state.member_cache_flags.online
cache_joined = self._state.member_cache_flags.joined
self_id = self._state.self_id
for mdata in guild.get('members', []):
member = Member(data=mdata, guild=self, state=state)
if cache_joined or (cache_online_members and member.raw_status != 'offline') or member.id == self_id:
if cache_joined or member.id == self_id:
self._add_member(member)
self._sync(guild)

Loading…
Cancel
Save