"""The MIT License (MIT)Copyright (c) 2021-present Pycord DevelopmentPermission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE."""fromtypingimportAnyfromtyping_extensionsimportSelf,overridefromdiscord.app.event_emitterimportEventfromdiscord.app.stateimportConnectionStatefromdiscord.channel.baseimportGuildChannelfromdiscord.guildimportGuildfromdiscord.inviteimportInvite,PartialInviteChannel,PartialInviteGuildfromdiscord.types.inviteimportGatewayInvite,VanityInvitefromdiscord.types.inviteimportInviteasInvitePayload
[docs]classInviteCreate(Event,Invite):"""Called when an invite is created. You must have :attr:`~Permissions.manage_channels` permission to receive this. .. note:: There is a rare possibility that the :attr:`Invite.guild` and :attr:`Invite.channel` attributes will be of :class:`Object` rather than the respective models. This requires :attr:`Intents.invites` to be enabled. This event inherits from :class:`Invite`. """__event_name__:str="INVITE_CREATE"def__init__(self)->None:...@classmethod@overrideasyncdef__load__(cls,data:GatewayInvite,state:ConnectionState)->Self|None:invite=awaitInvite.from_gateway(state=state,data=data)self=cls()self.__dict__.update(invite.__dict__)
[docs]classInviteDelete(Event,Invite):"""Called when an invite is deleted. You must have :attr:`~Permissions.manage_channels` permission to receive this. .. note:: There is a rare possibility that the :attr:`Invite.guild` and :attr:`Invite.channel` attributes will be of :class:`Object` rather than the respective models. Outside of those two attributes, the only other attribute guaranteed to be filled by the Discord gateway for this event is :attr:`Invite.code`. This requires :attr:`Intents.invites` to be enabled. This event inherits from :class:`Invite`. """__event_name__:str="INVITE_DELETE"def__init__(self)->None:...@classmethod@overrideasyncdef__load__(cls,data:GatewayInvite,state:ConnectionState)->Self|None:invite=awaitInvite.from_gateway(state=state,data=data)self=cls()self.__dict__.update(invite.__dict__)