Fix webhook_update from code review

This commit is contained in:
Jeremy Zhang 2018-08-23 06:49:53 +00:00 committed by Rapptz
parent 17f9916b03
commit d092c6635b
2 changed files with 4 additions and 3 deletions

View File

@ -780,8 +780,9 @@ class ConnectionState:
self.process_listeners(ListenerType.chunk, guild, len(members))
def parse_webhooks_update(self, data):
channel = self.get_channel(int(data["channel_id"]))
self.dispatch("webhooks_update", channel)
channel = self.get_channel(int(data['channel_id']))
if channel:
self.dispatch('webhooks_update', channel)
def parse_voice_state_update(self, data):
guild = self._get_guild(utils._get_as_snowflake(data, 'guild_id'))

View File

@ -384,7 +384,7 @@ to handle it, which defaults to print a traceback and ignoring the exception.
Called whenever a webhook is created, modified, or removed from a guild channel.
:param channel: The :class:`abc.GuildChannel` that had it's webhooks updated.
:param channel: The :class:`abc.GuildChannel` that had its webhooks updated.
.. function:: on_member_join(member)
on_member_remove(member)