mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-03 18:42:43 +00:00
Add guild_integrations_update event
This commit is contained in:
parent
cfc2e47b4f
commit
e920fe9a56
@ -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:
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user