diff options
| author | Jeremy Zhang <[email protected]> | 2018-07-09 05:29:02 +0000 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-09-15 18:28:57 -0400 |
| commit | 17f9916b03eeb3d108913d8191a12156fd79ab85 (patch) | |
| tree | 3c82dfca9b425f9b67df86eb8373ab863a269053 | |
| parent | Update Japanese string dump. (diff) | |
| download | discord.py-17f9916b03eeb3d108913d8191a12156fd79ab85.tar.xz discord.py-17f9916b03eeb3d108913d8191a12156fd79ab85.zip | |
Simple parser for WEBHOOKS_UPDATE
| -rw-r--r-- | discord/state.py | 4 | ||||
| -rw-r--r-- | docs/api.rst | 6 |
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) |