diff --git a/disco/state.py b/disco/state.py index 75531f7..689ab62 100644 --- a/disco/state.py +++ b/disco/state.py @@ -193,7 +193,12 @@ class State(object): event.guild.sync() def on_guild_update(self, event): - self.guilds[event.guild.id].update(event.guild) + self.guilds[event.guild.id].update(event.guild, ignored=[ + 'channels', + 'members', + 'voice_states', + 'presences' + ]) def on_guild_delete(self, event): if event.id in self.guilds: diff --git a/disco/types/base.py b/disco/types/base.py index 1d1341a..c3a061b 100644 --- a/disco/types/base.py +++ b/disco/types/base.py @@ -327,8 +327,11 @@ class Model(six.with_metaclass(ModelMeta, AsyncChainable)): value = field.try_convert(raw, self.client) setattr(inst, field.dst_name, value) - def update(self, other): + def update(self, other, ignored=None): for name in six.iterkeys(self._fields): + if ignored and name in ignored: + continue + if hasattr(other, name) and not getattr(other, name) is UNSET: setattr(self, name, getattr(other, name)) diff --git a/disco/types/channel.py b/disco/types/channel.py index 4c91d3c..311ca5c 100644 --- a/disco/types/channel.py +++ b/disco/types/channel.py @@ -149,8 +149,8 @@ class Channel(SlottedModel, Permissible): if not self.guild_id: return Permissions.ADMINISTRATOR - member = self.guild.members.get(user.id) - base = self.guild.get_permissions(user) + member = self.guild.get_member(user) + base = self.guild.get_permissions(member) for ow in six.itervalues(self.overwrites): if ow.id != user.id and ow.id not in member.roles: