aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/state.py5
-rw-r--r--docs/api.rst2
2 files changed, 4 insertions, 3 deletions
diff --git a/discord/state.py b/discord/state.py
index 28c6feb0..ea6b89de 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -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'))
diff --git a/docs/api.rst b/docs/api.rst
index 2695788f..eb2ea366 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -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)