Add guild_integrations_update event

This commit is contained in:
CraftSpider 2019-02-15 10:41:13 -05:00 committed by Rapptz
parent cfc2e47b4f
commit e920fe9a56
2 changed files with 13 additions and 0 deletions

View File

@ -790,6 +790,13 @@ 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_guild_integrations_update(self, data):
guild = self._get_guild(int(data['guild_id']))
if guild is not None:
self.dispatch('guild_integrations_update', guild)
else:
log.warning('GUILD_INTEGRATIONS_UPDATE referencing an unknown guild ID: %s. Discarding.', data['guild_id'])
def parse_webhooks_update(self, data):
channel = self.get_channel(int(data['channel_id']))
if channel:

View File

@ -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_guild_integrations_update(guild)
Called whenever an integration is created, modified, or removed from a guild.
:param guild: The :class:`Guild` that had its integrations updated.
.. function:: on_webhooks_update(channel)
Called whenever a webhook is created, modified, or removed from a guild channel.