aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/state.py4
-rw-r--r--docs/api.rst6
2 files changed, 10 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py
index e869fec0..28c6feb0 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -779,6 +779,10 @@ class ConnectionState:
log.info('Processed a chunk for %s members in guild ID %s.', len(members), guild_id)
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)
+
def parse_voice_state_update(self, data):
guild = self._get_guild(utils._get_as_snowflake(data, 'guild_id'))
channel_id = utils._get_as_snowflake(data, 'channel_id')
diff --git a/docs/api.rst b/docs/api.rst
index d1a5a346..2695788f 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -380,6 +380,12 @@ to handle it, which defaults to print a traceback and ignoring the exception.
:param last_pin: A ``datetime.datetime`` object representing when the latest message
was pinned or ``None`` if there are no pins.
+.. function:: on_webhooks_update(channel)
+
+ 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.
+
.. function:: on_member_join(member)
on_member_remove(member)