mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Add support for integration create/update/delete events
This commit is contained in:
@ -29,6 +29,7 @@ __all__ = (
|
||||
'RawReactionActionEvent',
|
||||
'RawReactionClearEvent',
|
||||
'RawReactionClearEmojiEvent',
|
||||
'RawIntegrationDeleteEvent',
|
||||
)
|
||||
|
||||
class _RawReprMixin:
|
||||
@ -222,3 +223,29 @@ class RawReactionClearEmojiEvent(_RawReprMixin):
|
||||
self.guild_id = int(data['guild_id'])
|
||||
except KeyError:
|
||||
self.guild_id = None
|
||||
|
||||
class RawIntegrationDeleteEvent(_RawReprMixin):
|
||||
"""Represents the payload for a :func:`on_raw_integration_delete` event.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
Attributes
|
||||
-----------
|
||||
integration_id: :class:`int`
|
||||
The ID of the integration that got deleted.
|
||||
application_id: Optional[:class:`int`]
|
||||
The ID of the bot/OAuth2 application for this deleted integration.
|
||||
guild_id: :class:`int`
|
||||
The guild ID where the integration got deleted.
|
||||
"""
|
||||
|
||||
__slots__ = ('integration_id', 'application_id', 'guild_id')
|
||||
|
||||
def __init__(self, data):
|
||||
self.integration_id = int(data['id'])
|
||||
self.guild_id = int(data['guild_id'])
|
||||
|
||||
try:
|
||||
self.application_id = int(data['application_id'])
|
||||
except KeyError:
|
||||
self.application_id = None
|
||||
|
Reference in New Issue
Block a user