
    i8              	      t   U d Z ddlmZ ddlZddlmZmZmZmZm	Z	m
Z
mZmZmZmZ ddlZddlZddlmZ ddlmZmZmZmZ ddlmZmZmZmZ dd	lmZ dd
lm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z:m;Z;m<Z< ddlm=Z= dZ>e	rddl?m@ZAmBZBmCZCmDZEmFZGmHZHmIZI ddlJm2ZK ddlLmMZM ddlNmOZO ddlPmQZQ ddlRmSZS ddlTmUZU ddlVmWZW dd lXmYZY dd!lZm[Z[m\Z\m]Z] dd"l^m_Z_m`Z` dd#lambZb dd$lmcZcmdZdmeZemfZfmgZgmhZhmiZi dd%ljmkZk dd&llmmZmmnZn dd'lompZp eecedeeefegekeheif         Zqed(         Zrejs        Zsd)etd*<    G d+ d,ee"                   Z@ G d- d.          Zu G d/ d0ee"                   Zv G d1 d2ee"                   Zw G d3 d4          Zx G d5 d6e*          ZydS )7a:  
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotationsN)
AnyDictOptionalGenericTYPE_CHECKINGSequenceTupleUnionListoverload   )utils)try_enumLocaleInteractionTypeInteractionResponseType)InteractionRespondedHTTPExceptionClientExceptionDiscordException)MessageFlags)ChannelType)ClientT)Entitlement)User)Member)Message
Attachment)Permissions)handle_message_parameters)async_contextWebhookinteraction_response_params#interaction_message_response_params)AppCommandContext)	Namespace)
locale_strTranslationContextTranslationContextLocation)_threaded_channel_factory)InteractionInteractionMessageInteractionResponseInteractionCallbackResponse#InteractionCallbackActivityInstance)r,   InteractionData!ApplicationCommandInteractionDataInteractionCallbackInteractionCallbackActivityMessageComponentInteractionDataModalSubmitInteractionData)r#   )	Snowflake)Guild)ConnectionState)File)AllowedMentions)ClientSession)Embed)BaseViewView
LayoutView)ChoiceChoiceT)Modal)VoiceChannelStageChannelTextChannelForumChannelCategoryChannel	DMChannelGroupChannel)Thread)CommandContextMenu)Poll)r-   r0   r   MISSINGc                  l   e Zd ZU dZdZded<   dJd	ZdKdZdLdZe	dMd            Z
e	dNd            Ze	dOd            Ze	dPd            Ze	dPd            Z ej        d          dQd            Z ej        d          dRd            Z ej        d          dOd            Z ej        d          dSd!            Z ej        d"          dTd$            Ze	dUd&            Ze	dUd'            Z ej        d(          dVd*            ZdWd,ZdWd-ZdWd.ZdXd0Zeeeeed1ed2dYd@ZdZdBZeedCd[dIZ d1S )\r,   a  Represents a Discord interaction.

    An interaction happens when a user does an action that needs to
    be notified. Current examples are slash commands and components.

    .. versionadded:: 2.0

    Attributes
    -----------
    id: :class:`int`
        The interaction's ID.
    type: :class:`InteractionType`
        The interaction type.
    guild_id: Optional[:class:`int`]
        The guild ID the interaction was sent from.
    channel: Optional[Union[:class:`abc.GuildChannel`, :class:`abc.PrivateChannel`, :class:`Thread`]]
        The channel the interaction was sent from.

        Note that due to a Discord limitation, if sent from a DM channel :attr:`~DMChannel.recipient` is ``None``.
    entitlement_sku_ids: List[:class:`int`]
        The entitlement SKU IDs that the user has.
    entitlements: List[:class:`Entitlement`]
        The entitlements that the guild or user has.
    application_id: :class:`int`
        The application ID that the interaction was for.
    user: Union[:class:`User`, :class:`Member`]
        The user or member that sent the interaction.
    message: Optional[:class:`Message`]
        The message that sent this interaction.

        This is only available for :attr:`InteractionType.component` interactions.
    token: :class:`str`
        The token to continue the interaction. These are valid
        for 15 minutes.
    data: :class:`dict`
        The raw interaction data.
    locale: :class:`Locale`
        The locale of the user invoking the interaction.
    guild_locale: Optional[:class:`Locale`]
        The preferred locale of the guild the interaction was sent from, if any.
    extras: :class:`dict`
        A dictionary that can be used to store extraneous data for use during
        interaction processing. The library will not touch any values or keys
        within this dictionary.
    command_failed: :class:`bool`
        Whether the command associated with this interaction failed to execute.
        This includes checks and execution.
    context: :class:`.AppCommandContext`
        The context of the interaction.

        .. versionadded:: 2.4
    filesize_limit: int
        The maximum number of bytes a file can have when responding to this interaction.

        .. versionadded:: 2.6
    ) idtypeguild_iddataapplication_idmessageusertokenversionlocaleguild_localeextrascommand_failedentitlement_sku_idsentitlementscontextfilesize_limit_integration_owners_permissions_app_permissions_state_client_session_baton_original_response_cs_response_cs_followupchannel_cs_namespace_cs_command_cs_command_id_cs_custom_idTuple[str, ...]	__slots__rT   InteractionPayloadstateConnectionState[ClientT]c                   || _         |                                | _        |j        j        | _        d | _        t          | _        i | _	        d| _
        |                     |           d S )NF)re   _get_clientrf   http_HTTPClient__sessionrg   ri   rO   rh   r\   r]   
_from_data)selfrT   rt   s      [/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/interactions.py__init__zInteraction.__init__   s`    05 % 1 1 3 3',z'F@D #&($)    returnstrc                b    d| j         j         d| j         d| j        d| j        d| j        dS )N<z id= type=z
 guild_id=z user=>)	__class____name__rQ   rR   rS   rW   r{   s    r|   __repr__zInteraction.__repr__   sD    {4>*{{{{ty{{VZVc{{mqmv{{{{r~   c                 	    t          |d                    _        t          t          |d                    _        |                    d           _        |d          _        |d          _        t          j
        |d           _        d  _        t          |d                    _        d |                    d	g           pg D              _         fd
|                    dg           D              _        |d          _        d |                    di                                           D              _        	 |d         }t'          j        |g           _        n## t,          $ r t'                       _        Y nw xY wt          t.          |                    dd                     _          	 t          t.          |d                    _        n# t,          $ r
 d  _        Y nw xY wd } j        r j                             j        |                    d                    }|j        E j        j        9|                    tA          j!         j        j        | j                             |                    di           }t          j
        |d          }|||o|"                    |           _        |                    d          } j        |tG          |          \  }}|(tI          j%        d&                    |                     nW|tN          j(        tN          j)        fv r# | j        j        | j                   _        n| || j        |           _          	 tU           j         j        |d                    _+        n# t,          $ r
 d  _+        Y nw xY wtX           _        d _-        t          |                    dd                     _.        |j j+         j+        j/        | j+        _/        	 |d         }	tA           j        ||	           _         j        j-        pd _-        d S # t,          $ r Y d S w xY w	 ta           j        |d          !           _        d S # t,          $ r Y d S w xY w)"NrQ   rR   rT   rX   rY   rS   rU   c                ,    g | ]}t          |          S  int).0xs     r|   
<listcomp>z*Interaction._from_data.<locals>.<listcomp>   s    .f.f.f!s1vv.f.f.fr~   entitlement_skusc                :    g | ]}t          j        |          S r   )r   re   )r   r   r{   s     r|   r   z*Interaction._from_data.<locals>.<listcomp>   s&    /r/r/rPQDK0K0K/r/r/rr~   r_   attachment_size_limitc                N    i | ]"\  }}t          |          t          |          #S r   r   )r   kvs      r|   
<dictcomp>z*Interaction._from_data.<locals>.<dictcomp>   s7     :
 :
 :
#q!CFFCFF:
 :
 :
r~   authorizing_integration_ownersr`   rZ   zen-USr[   guild)rT   )rW   r   rt   rl   z0Unknown channel type {type} for channel ID {id}.)merT   rt   )r   rt   rT   rV   rt   rl   rT   r   app_permissionsmember)rt   r   rT   rW   )rt   rT   )1r   rQ   r   r   rR   getrT   rX   rY   r   _get_as_snowflakerS   rl   rU   r^   r_   ra   itemsrb   r&   _from_valuer`   KeyErrorr   rZ   r[   re    _get_or_create_unavailable_guildr   rf   rW   _add_memberr   _from_client_user_resolve_channelr+   logginginfo
format_mapr   groupprivater   rV   rO   rc   rd   r   r   )
r{   rT   valuer   raw_channel
channel_idraw_ch_typefactorych_typer   s
   `         r|   rz   zInteraction._from_data   s   4:%-otF|%L%L	/3xx/?/?	w-
 O','>tZ'P'P59#&t,<'=#>#>.f.ftxxHZ\^?_?_?ece.f.f.f /r/r/r/rUYU]U]^lnpUqUq/r/r/r#'(?#@:
 :
'+xx0PRT'U'U'['[']']:
 :
 :
 	/OE,8%AADLL 	/ 	/ 	/,..DLLL	/ 'vtxx'/J/JKK+	% (n1E F FD 	% 	% 	% $D	% = 	tK@@UYU]U]^eUfUf@ggExDL$5$A!!&":@QY^fjfq"r"r"rssshhy"--,[$??
!e&7 GU%;%;J%G%GDL!oof--<K$;8EEGWOZZ[fgghhhh{0+2EFFF#*7dl.?kY]Yd#e#e#eDLL&#*7dkP[#\#\#\DL'	 "dlQUV_Q`aaaDLL 	  	  	 DLLL	  *1	!"%(2CQ)G)G%H%H|'DL,>,F%*"@h #EOOO	$(I$:$?a!!!	     t{fFFF			   sZ   >"E! !F F5 G G*)G*5'N N10N1Q
 

QQ!Q? ?
RRr   c                    | j         S )z:class:`Client`: The client that is handling this interaction.

        Note that :class:`AutoShardedClient`, :class:`~.commands.Bot`, and
        :class:`~.commands.AutoShardedBot` are all subclasses of client.
        )rf   r   s    r|   clientzInteraction.client(  s     |r~   Optional[Guild]c                z    | j         r| j                             | j                  pt          | j        dd          S )zBOptional[:class:`Guild`]: The guild the interaction was sent from.r   N)re   
_get_guildrS   getattrrW   r   s    r|   r   zInteraction.guild1  s:     E 6 6t} E Ek'RVR[]dfjJkJkkr~   Optional[int]c                ,    | j         | j         j        ndS )zLOptional[:class:`int`]: The ID of the channel the interaction was sent from.N)rl   rQ   r   s    r|   r   zInteraction.channel_id9  s     #',":t|Dr~   r    c                *    t          | j                  S )z:class:`Permissions`: The resolved permissions of the member in the channel, including overwrites.

        In a non-guild context where this doesn't apply, an empty permissions object is returned.
        )r    rc   r   s    r|   permissionszInteraction.permissions>  s     4,---r~   c                *    t          | j                  S )zc:class:`Permissions`: The resolved permissions of the application or the bot, including overwrites.)r    rd   r   s    r|   r   zInteraction.app_permissionsF  s     40111r~   rm   r'   c                P   | j         t          j        t          j        fvrt	          | i g           S | j        j        }|t	          | i g           S | j        }	 |                    |          \  }}n# t          $ r g }Y nw xY wt	          | |
                    di           |          S )a  :class:`app_commands.Namespace`: The resolved namespace for this interaction.

        If the interaction is not an application command related interaction or the client does not have a
        tree attached to it then this returns an empty namespace.
        Nresolved)rR   r   application_commandautocompleter'   re   _command_treerT   _get_app_command_optionsr   r   )r{   treerT   _optionss        r|   	namespacezInteraction.namespaceK  s     9_@/B^___T2r***{(<T2r*** 37)	66t<<JAww 	 	 	GGG	 txx
B77AAAs   A1 1B ?B rn   4Optional[Union[Command[Any, ..., Any], ContextMenu]]c                ,   | j         t          j        t          j        fvrdS | j        j        }|dS | j        }|                    dd          }|dk    r,	 |                    |          \  }}|S # t          $ r Y dS w xY w|
                    |          S )a>  Optional[Union[:class:`app_commands.Command`, :class:`app_commands.ContextMenu`]]: The command being called from
        this interaction.

        If the interaction is not an application command related interaction or the command is not found in the client's
        attached tree then ``None`` is returned.
        NrR   r   )rR   r   r   r   re   r   rT   r   r   r   _get_context_menu)r{   r   rT   cmd_typecommandr   s         r|   r   zInteraction.commandc  s     9_@/B^___4{(<4 37)88FA&&q==!::4@@
  $   tt
 ))$///s   A0 0
A>=A>ro   c                    | j         t          j        t          j        fvrdS | j        }t          |                    dd                    S )a  Optional[:class:`int`]: The ID of the command that triggered this interaction.

        Only applicable if :attr:`type` is one of, :attr:`InteractionType.application_command` or
        :attr:`InteractionType.autocomplete`.

        .. versionadded:: 2.7
        NrQ   r   )rR   r   r   r   rT   r   r   r{   rT   s     r|   
command_idzInteraction.command_id  sD     9_@/B^___426)488D!$$%%%r~   rj   InteractionResponse[ClientT]c                     t          |           S )z:class:`InteractionResponse`: Returns an object responsible for handling responding to the interaction.

        A response can only be done once. If secondary messages need to be sent, consider using :attr:`followup`
        instead.
        )r.   r   s    r|   responsezInteraction.response  s     #4(((r~   rk   r#   c                X    | j         d| j        d}t          j        || j                  S )zK:class:`Webhook`: Returns the follow up webhook for follow up interactions.   )rQ   rR   rX   )rT   rt   )rU   rX   r#   
from_statere   )r{   payloads     r|   followupzInteraction.followup  s8     %Z#
 #

 !wdkBBBBr~   datetime.datetimec                4    t          j        | j                  S )z=:class:`datetime.datetime`: When the interaction was created.)r   snowflake_timerQ   r   s    r|   
created_atzInteraction.created_at  s     #DG,,,r~   c                <    | j         t          j        d          z   S )z9:class:`datetime.datetime`: When the interaction expires.   )minutes)r   datetime	timedeltar   s    r|   
expires_atzInteraction.expires_at  s     !3B!?!?!???r~   rp   Optional[str]c                |    | j         t          j        t          j        fvrdS | j        }|                    d          S )a  Optional[:class:`str`]: The custom ID of the component that triggered this interaction.

        Only applicable if :attr:`type` is one of, :attr:`InteractionType.component` or
        :attr:`InteractionType.modal_submit`.

        .. versionadded:: 2.7
        N	custom_id)rR   r   	componentmodal_submitrT   r   r   s     r|   r   zInteraction.custom_id  s;     9_68TUUU4SWS\xx$$$r~   boolc                :    t          j                    | j        k    S )z>:class:`bool`: Returns ``True`` if the interaction is expired.)r   utcnowr   r   s    r|   
is_expiredzInteraction.is_expired  s    |~~00r~   c                Z    | j         r#| j         | j                            d          k    S dS )zr:class:`bool`: Returns ``True`` if the interaction is a guild integration.

        .. versionadded:: 2.4
        r   F)rS   rb   r   r   s    r|   is_guild_integrationz Interaction.is_guild_integration  s2    
 = 	D=D$<$@$@$C$CCCur~   c                R    | j         j        | j                            d          k    S )zq:class:`bool`: Returns ``True`` if the interaction is a user integration.

        .. versionadded:: 2.4
        r   )rW   rQ   rb   r   r   s    r|   is_user_integrationzInteraction.is_user_integration  s$    
 y|t7;;A>>>>r~   r-   c                b  K   | j         | j         S | j        }|t          d          t          j                    }| j        j        }|                    | j        | j	        | j
        |j        |j                   d{V }t          | | j                  }t          |||          }|| _         |S )a  |coro|

        Fetches the original interaction response message associated with the interaction.

        If the interaction response was a newly created message (i.e. through :meth:`InteractionResponse.send_message`
        or :meth:`InteractionResponse.defer`, where ``thinking`` is ``True``) then this returns the message that was sent
        using that response. Otherwise, this returns the message that triggered the interaction (i.e.
        through a component).

        Repeated calls to this will return a cached value.

        Raises
        -------
        HTTPException
            Fetching the original response message failed.
        ClientException
            The channel for the message could not be resolved.
        NotFound
            The interaction response message does not exist.

        Returns
        --------
        InteractionMessage
            The original interaction response message.
        Nz)Channel for message could not be resolved)rU   rX   sessionproxy
proxy_authr   )ri   rl   r   r"   r   re   rx   !get_original_interaction_responserU   rX   rg   r   r   _InteractionMessageStater-   )r{   rl   adapterrx   rT   rt   rV   s          r|   original_responsezInteraction.original_response  s      6 ".** ,?!"MNNN#%%{>>.*M* ? 
 
 
 
 
 
 
 
 )t{;;$5'MMM")r~   Ncontentembedsembedattachmentsviewallowed_mentionspollr   r   Sequence[Embed]r   Optional[Embed]r   !Sequence[Union[Attachment, File]]r   !Optional[Union[View, LayoutView]]r   Optional[AllowedMentions]r   rN   c               @  K   | j         j        }t          ||||||||          5 }	t          j                    }
| j         j        }|
                    | j        | j        | j	        |j
        |j        |	j        |	j        |	j                   d{V }ddd           n# 1 swxY w Y   t          | | j                   }t!          || j        |          }|rH|                                s4|                                r | j                             ||j                   |S )a	  |coro|

        Edits the original interaction response message.

        This is a lower level interface to :meth:`InteractionMessage.edit` in case
        you do not want to fetch the message and save an HTTP request.

        This method is also the only way to edit the original message if
        the message sent was ephemeral.

        Parameters
        ------------
        content: Optional[:class:`str`]
            The content to edit the message with or ``None`` to clear it.
        embeds: List[:class:`Embed`]
            A list of embeds to edit the message with.
        embed: Optional[:class:`Embed`]
            The embed to edit the message with. ``None`` suppresses the embeds.
            This should not be mixed with the ``embeds`` parameter.
        attachments: List[Union[:class:`Attachment`, :class:`File`]]
            A list of attachments to keep in the message as well as new files to upload. If ``[]`` is passed
            then all attachments are removed.

            .. note::

                New files will always appear after current attachments.

        allowed_mentions: :class:`AllowedMentions`
            Controls the mentions being processed in this message.
            See :meth:`.abc.Messageable.send` for more information.
        view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
            The updated view to update this message with. If ``None`` is passed then
            the view is removed.

            .. note::

                If you want to update the message to have a :class:`~discord.ui.LayoutView`, you must
                explicitly set the ``content``, ``embed``, ``embeds``, and ``attachments`` parameters to
                ``None`` if the previous message had any.
        poll: :class:`Poll`
            The poll to create when editing the message.

            .. versionadded:: 2.5

            .. note::

                This is only accepted when the response type is :attr:`InteractionResponseType.deferred_channel_message`.

        Raises
        -------
        HTTPException
            Editing the message failed.
        NotFound
            The interaction response message does not exist.
        Forbidden
            Edited a message that is not yours.
        TypeError
            You specified both ``embed`` and ``embeds``
        ValueError
            The length of ``embeds`` was invalid.

        Returns
        --------
        :class:`InteractionMessage`
            The newly edited message.
        )r   r   r   r   r   r   previous_allowed_mentionsr   )r   r   r   r   	multipartfilesNr   )re   r   r!   r"   r   rx   "edit_original_interaction_responserU   rX   rg   r   r   r   r  r  r   r-   rl   is_finishedis_dispatchable
store_viewrQ   )r{   r   r   r   r   r   r   r   previous_mentionsparamsr   rx   rT   rt   rV   s                  r|   edit_original_responsez"Interaction.edit_original_response   s     \ 8<{7S&#-&7	
 	
 	
 	 #'))G;#D CC#
j? *l D 	 	 	 	 	 	 	 	D	 	 	 	 	 	 	 	 	 	 	 	 	 	 	0 )t{;;$5$,TRRR 	5((** 	5t/C/C/E/E 	5K""4444s   A+BB!$B!Nonec                   K   t          j                    }| j        j        }|                    | j        | j        | j        |j        |j	                   d{V  dS )a  |coro|

        Deletes the original interaction response message.

        This is a lower level interface to :meth:`InteractionMessage.delete` in case
        you do not want to fetch the message and save an HTTP request.

        Raises
        -------
        HTTPException
            Deleting the message failed.
        NotFound
            The interaction response message does not exist or has already been deleted.
        Forbidden
            Deleted a message that is not yours.
        )r   r   r   N)
r"   r   re   rx   $delete_original_interaction_responserU   rX   rg   r   r   )r{   r   rx   s      r|   delete_original_responsez$Interaction.delete_original_responsem  s      "  #%%{::JM* ; 
 
 	
 	
 	
 	
 	
 	
 	
 	
 	
r~   )rZ   rT   stringUnion[str, locale_str]rZ   r   r   c               .  K   | j         j        }|sdS t          |t                    st          |          }|t          u r| j        }|t          u r| j        p| j        }t          t          j
        |          }|                    |||           d{V S )a  |coro|

        Translates a string using the set :class:`~discord.app_commands.Translator`.

        .. versionadded:: 2.1

        Parameters
        ----------
        string: Union[:class:`str`, :class:`~discord.app_commands.locale_str`]
            The string to translate.
            :class:`~discord.app_commands.locale_str` can be used to add more context,
            information, or any metadata necessary.
        locale: :class:`Locale`
            The locale to use, this is handy if you want the translation
            for a specific locale.
            Defaults to the user's :attr:`.locale`.
        data: Any
            The extraneous data that is being translated.
            If not specified, either :attr:`.command` or :attr:`.message` will be passed,
            depending on which is available in the context.

        Returns
        --------
        Optional[:class:`str`]
            The translated string, or ``None`` if a translator was not set.
        N)locationrT   )rZ   r`   )re   _translator
isinstancer(   rO   rZ   r   rV   r)   r*   other	translate)r{   r  rZ   rT   
translatorr`   s         r|   r  zInteraction.translate  s      : [,
 	4&*-- 	(''FW[F7??</4<D$.H.NUYZZZ))&)QQQQQQQQQr~   )rT   rs   rt   ru   r   r   )rT   rs   )r   r   )r   r   )r   r   )r   r    )r   r'   )r   r   )r   r   )r   r#   )r   r   )r   r   r   r   )r   r-   )r   r   r   r   r   r   r   r   r   r  r   r  r   rN   r   r-   r   r  )r  r  rZ   r   rT   r   r   r   )!r   
__module____qualname____doc__rr   __annotations__r}   r   rz   propertyr   r   r   r   r   r   cached_slot_propertyr   r   r   r   r   r   r   r   r   r   r   r   rO   r  r  r  r   r~   r|   r,   r,   k   s\        7 7r!"I ! ! ! !F
 
 
 
| | | |O O O Ob    X l l l Xl E E E XE . . . X. 2 2 2 X2  U00B B B 10B.  U..0 0 0 /.06  U 011& & & 21&  U//) ) ) 0/)  U//C C C 0/C - - - X- @ @ @ X@  U00% % % 10%1 1 1 1   ? ? ? ?0 0 0 0j ")")!(9@296:k k k k k kZ
 
 
 
8 CJW^)R )R )R )R )R )R )R )Rr~   r,   c                      e Zd ZdZdZd	dZdS )
r0   zRepresents an activity instance launched as an interaction response.

    .. versionadded:: 2.5

    Attributes
    ----------
    id: :class:`str`
        The activity instance ID.
    rQ   rT   "InteractionCallbackActivityPayloadr   r  c                     |d         | _         d S )NrQ   r%  r   s     r|   r}   z,InteractionCallbackActivityInstance.__init__  s    Dzr~   N)rT   r&  r   r  )r   r  r  r   rr   r}   r   r~   r|   r0   r0     s9          I" " " " " "r~   r0   c                  >    e Zd ZdZdZddZddZddZddZddZ	dS )r/   a  Represents an interaction response callback.

    .. versionadded:: 2.5

    Attributes
    ----------
    id: :class:`int`
        The interaction ID.
    type: :class:`InteractionResponseType`
        The interaction callback response type.
    resource: Optional[Union[:class:`InteractionMessage`, :class:`InteractionCallbackActivityInstance`]]
        The resource that the interaction response created. If a message was sent, this will be
        a :class:`InteractionMessage`. If an activity was launched this will be a
        :class:`InteractionCallbackActivityInstance`. In any other case, this will be ``None``.
    message_id: Optional[:class:`int`]
        The message ID of the resource. Only available if the resource is a :class:`InteractionMessage`.
    activity_id: Optional[:class:`str`]
        The activity ID of the resource. Only available if the resource is a :class:`InteractionCallbackActivityInstance`.
    )	re   _parentrR   rQ   	_thinking
_ephemeral
message_idactivity_idresourcerT   InteractionCallbackPayloadparentInteraction[ClientT]rt   r9   rR   r   r   r  c               Z    || _         || _        || _        |                     |           d S N)re   r)  rR   _update)r{   rT   r0  rt   rR   s        r|   r}   z$InteractionCallbackResponse.__init__  s1     (--3-1	Tr~   r   c                (    d| j          d| j        dS )Nz <InteractionCallbackResponse id=r   r   )rQ   rR   r   s    r|   r   z$InteractionCallbackResponse.__repr__  s    O$'OOOOOOr~   c                   |d         }t          |d                   | _        |                    dd          | _        |                    dd          | _        t          j        |d          | _        |                    d          | _        d | _	        |                    d          }|t          t          |d	                   | _        |                    d
          }|                    d          }|;t          t          | j        | j                  | j        j        |          | _	        d S |t%          |          | _	        d S d S d S )NinteractionrQ   response_message_loadingFresponse_message_ephemeralresponse_message_idactivity_instance_idr.  rR   rV   activity_instancer   )r   rQ   r   r*  r+  r   r   r,  r-  r.  r   r   rR   r-   r   r)  re   rl   r0   )r{   rT   r7  r.  rV   r<  s         r|   r4  z#InteractionCallbackResponse._update  s7   =);t,--*/I5QQ +0Le T T).)@Nc)d)d*5//:P*Q*Q?C88J'' !8(6:JKKDIll9--G (-@ A A" 224<MM L0 ! ! !
 #. CDU V V   /.r~   r   c                    | j         S )z9:class:`bool`: Whether the response was a thinking defer.)r*  r   s    r|   is_thinkingz'InteractionCallbackResponse.is_thinking  s
    ~r~   c                    | j         S )z2:class:`bool`: Whether the response was ephemeral.)r+  r   s    r|   is_ephemeralz(InteractionCallbackResponse.is_ephemeral  s
    r~   N)
rT   r/  r0  r1  rt   r9   rR   r   r   r  r  )rT   r/  r   r  r  )
r   r  r  r   rr   r}   r   r4  r>  r@  r   r~   r|   r/   r/     s         (
I   P P P PW W W W6        r~   r/   c                      e Zd ZU dZdZded<   dAdZdBd
ZedCd            Z	ddddDdZ
dEdZeeededddddFd$            Ze	 dGeeeeeddeddded%dHd0            Z	 dGeeeeeddeddded%dId2Zeeeeeeded3dJd9ZdKd<ZdLd?ZdMd@ZdS )Nr.   zRepresents a Discord interaction response.

    This type can be accessed through :attr:`Interaction.response`.

    .. versionadded:: 2.0
    )_response_typer)  rq   rr   r0  r1  c                "    || _         d | _        d S r3  )r)  rB  )r{   r0  s     r|   r}   zInteractionResponse.__init__'  s    -3AEr~   r   r   c                    | j         duS )z:class:`bool`: Indicates whether an interaction response has been done before.

        An interaction can only be responded to once.
        NrB  r   s    r|   is_donezInteractionResponse.is_done+  s    
 "$..r~   !Optional[InteractionResponseType]c                    | j         S )zg:class:`InteractionResponseType`: The type of response that was sent, ``None`` if response is not done.rE  r   s    r|   rR   zInteractionResponse.type2  s     ""r~   F)	ephemeralthinkingrI  rJ  .Optional[InteractionCallbackResponse[ClientT]]c                 K   | j         rt          | j                  d}d}| j        }|j        t          j        u s|j        t          j        u r-|rt          j        j	        nt          j
        j	        }|r|rddi}n*|j        t          j        u rt          j        j	        }|rddi}|rt          j                    }t          ||          }|j        j        }|                    |j        |j        |j        |j        |j        |           d{V }	t          |          | _         t/          |	| j        | j        j        | j                   S dS )a  |coro|

        Defers the interaction response.

        This is typically used when the interaction is acknowledged
        and a secondary action will be done later.

        This is only supported with the following interaction types:

        - :attr:`InteractionType.application_command`
        - :attr:`InteractionType.component`
        - :attr:`InteractionType.modal_submit`

        .. versionchanged:: 2.5
            This now returns a :class:`InteractionCallbackResponse` instance.

        Parameters
        -----------
        ephemeral: :class:`bool`
            Indicates whether the deferred message will eventually be ephemeral.
            This only applies to :attr:`InteractionType.application_command` interactions, or if ``thinking`` is ``True``.
        thinking: :class:`bool`
            Indicates whether the deferred type should be :attr:`InteractionResponseType.deferred_channel_message`
            instead of the default :attr:`InteractionResponseType.deferred_message_update` if both are valid.
            In UI terms, this is represented as if the bot is thinking of a response. It is your responsibility to
            eventually send a followup message via :attr:`Interaction.followup` to make this thinking state go away.
            Application commands (AKA Slash commands) cannot use :attr:`InteractionResponseType.deferred_message_update`.

        Raises
        -------
        HTTPException
            Deferring the interaction failed.
        InteractionResponded
            This interaction has already been responded to before.

        Returns
        -------
        Optional[:class:`InteractionCallbackResponse`]
            The interaction callback resource, or ``None``.
        r   Nflags@   rR   rT   r   r   r   r  rT   r0  rt   rR   )rB  r   r)  rR   r   r   r   r   deferred_channel_messager   deferred_message_updater   r"   r   r$   re   rx   create_interaction_responserQ   rX   rg   r   r   r/   )
r{   rI  rJ  
defer_typerT   r0  r   r  rx   r   s
             r|   deferzInteractionResponse.defer7  s     \  	5&t|444
)-;/333v{oFb7b7b K'@FF,DJ 
  %I %}[O???0IOJ %} 	#'))G0jtLLLF=%D$@@	j? A        H #:*"E"ED.|l)(	   	 	r~   r  c                  K   | j         rt          | j                  | j        }|j        t          j        u rt          j                    }t          t          j
        j                  }|j        j        }|                    |j        |j        |j        |j        |j        |           d{V  t          j
        | _         dS dS )a  |coro|

        Pongs the ping interaction.

        This should rarely be used.

        Raises
        -------
        HTTPException
            Ponging the interaction failed.
        InteractionResponded
            This interaction has already been responded to before.
        rP  N)rB  r   r)  rR   r   pingr"   r   r$   r   pongr   re   rx   rT  rQ   rX   rg   r   r   )r{   r0  r   r  rx   s        r|   rY  zInteractionResponse.pong  s        	5&t|444;/...#'))G01H1M1STTF=%D55	j? 6          #:">D /.r~   N)filer  rI  r   suppress_embedssilentdelete_afterrZ  r:   r  Sequence[File]r   r@   r   r;   r[  r\  r]  Optional[float]$InteractionCallbackResponse[ClientT]c               
   K   d S r3  r   )	r{   rZ  r  r   rI  r   r[  r\  r]  s	            r|   send_messagez InteractionResponse.send_message  s       03sr~   )r   r   rZ  r  r   ttsrI  r   r[  r\  r]  r   r   Optional[Any]r   r=   r   r   r?   rc  r   rN   c               
   K   d S r3  r   )r{   r   r   r   rZ  r  r   rc  rI  r   r[  r\  r]  r   s                 r|   rb  z InteractionResponse.send_message  s      " 03sr~   r>   c               8   K    j         rt           j                  |s|
s|r*t          j        d          }||_        |
|_        ||_        nt          } j        }t          j
                    }t          t          j        j        |||||||j        j        |	|||          }|j        j        }|                    |j        |j        |j        |j        |j        |           d{V }t          j         _         t1          | j         j        j         j                   }|t          urI|                                s5|r|j        d|_         j        j                            ||j                   |$|fd
 fd	}t;          j         |                       |S )a
  |coro|

        Responds to this interaction by sending a message.

        .. versionchanged:: 2.5
            This now returns a :class:`InteractionCallbackResponse` instance.

        Parameters
        -----------
        content: Optional[:class:`str`]
            The content of the message to send.
        embeds: List[:class:`Embed`]
            A list of embeds to send with the content. Maximum of 10. This cannot
            be mixed with the ``embed`` parameter.
        embed: :class:`Embed`
            The rich embed for the content to send. This cannot be mixed with
            ``embeds`` parameter.
        file: :class:`~discord.File`
            The file to upload.
        files: List[:class:`~discord.File`]
            A list of files to upload. Must be a maximum of 10.
        tts: :class:`bool`
            Indicates if the message should be sent using text-to-speech.
        view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
            The view to send with the message.
        ephemeral: :class:`bool`
            Indicates if the message should only be visible to the user who started the interaction.
            If a view is sent with an ephemeral message and it has no timeout set then the timeout
            is set to 15 minutes.
        allowed_mentions: :class:`~discord.AllowedMentions`
            Controls the mentions being processed in this message. See :meth:`.abc.Messageable.send` for
            more information.
        suppress_embeds: :class:`bool`
            Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.
        silent: :class:`bool`
            Whether to suppress push and desktop notifications for the message. This will increment the mention counter
            in the UI, but will not actually send a notification.

            .. versionadded:: 2.2
        delete_after: :class:`float`
            If provided, the number of seconds to wait in the background
            before deleting the message we just sent. If the deletion fails,
            then it is silently ignored.

            .. versionadded:: 2.1
        poll: :class:`~discord.Poll`
            The poll to send with this message.

            .. versionadded:: 2.4

        Raises
        -------
        HTTPException
            Sending the message failed.
        TypeError
            You specified both ``embed`` and ``embeds`` or ``file`` and ``files``.
        ValueError
            The length of ``embeds`` was invalid.
        InteractionResponded
            This interaction has already been responded to before.

        Returns
        -------
        :class:`InteractionCallbackResponse`
            The interaction callback data.
        r   )rR   r   rc  r   r   rZ  r  r  r   rM  r   r   rP  NrQ  g      @delayfloatc                   K   t          j        |            d {V  	 j                                         d {V  d S # t          $ r Y d S w xY wr3  asynciosleepr)  r  r   rg  r{   s    r|   
inner_callz4InteractionResponse.send_message.<locals>.inner_callU  |      mE*********,??AAAAAAAAAAA$   DD   A   
AArg  rh  )rB  r   r)  r   r   rI  r[  suppress_notificationsrO   r"   r   r%   r   channel_messager   re   r   rx   rT  rQ   rX   rg   r   r   r/   r  timeoutr
  r,  rk  create_task)r{   r   r   r   rZ  r  r   rc  rI  r   r[  r\  r]  r   rM  r0  r   r  rx   rT   r   rn  s   `                     r|   rb  z InteractionResponse.send_message  s     f  	5&t|444 	 	6 	 ,Q//E'EO$3E!+1E((E#%%4(8>&,m&D-
 
 
 }!88ILO* 9 
 
 
 
 
 
 
 
 6E.<,%$	
 
 
 wt'7'7'9'9 )T\1(L**41DEEE#0<        

---r~   )r   r   r   r   r   r   r]  r[  r   r   r   r  r  c                  K    j         rt           j                   j        }	|	j        }
|	j        }|
|
j        }nd}|	j        t          j        t          j	        fvrdS |t          ur||                    |           |t          urt          j        d          }||_        nt          }t          j                    }t#          t$          j        j        ||||||	j        j        ||	  	        }|	j        j        }|                    |	j        |	j        |	j        |j        |j        |           d{V }t$          j         _         t9          | j         j        j         j                   }|rE|                                s1|                                r|                    ||p|j                    |$|fd	 fd}tC          j"         |                       |S )
a
  |coro|

        Responds to this interaction by editing the original message of
        a component or modal interaction.

        .. versionchanged:: 2.5
            This now returns a :class:`InteractionCallbackResponse` instance.

        Parameters
        -----------
        content: Optional[:class:`str`]
            The new content to replace the message with. ``None`` removes the content.
        embeds: List[:class:`Embed`]
            A list of embeds to edit the message with.
        embed: Optional[:class:`Embed`]
            The embed to edit the message with. ``None`` suppresses the embeds.
            This should not be mixed with the ``embeds`` parameter.
        attachments: List[Union[:class:`Attachment`, :class:`File`]]
            A list of attachments to keep in the message as well as new files to upload. If ``[]`` is passed
            then all attachments are removed.

            .. note::

                New files will always appear after current attachments.

        view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
            The updated view to update this message with. If ``None`` is passed then
            the view is removed.

            .. note::

                To update the message to add a :class:`~discord.ui.LayoutView`, you
                must explicitly set the ``content``, ``embed``, ``embeds``, and
                ``attachments`` parameters to either ``None`` or an empty array, as appropriate.
        allowed_mentions: Optional[:class:`~discord.AllowedMentions`]
            Controls the mentions being processed in this message. See :meth:`.Message.edit`
            for more information.
        delete_after: :class:`float`
            If provided, the number of seconds to wait in the background
            before deleting the message we just edited. If the deletion fails,
            then it is silently ignored.

            .. versionadded:: 2.2
        suppress_embeds: :class:`bool`
            Whether to suppress embeds for the message. This removes
            all the embeds if set to ``True``. If set to ``False``
            this brings the embeds back if they were suppressed.
            Using this parameter requires :attr:`~.Permissions.manage_messages`.

            .. versionadded:: 2.4

        Raises
        -------
        HTTPException
            Editing the message failed.
        TypeError
            You specified both ``embed`` and ``embeds``.
        InteractionResponded
            This interaction has already been responded to before.

        Returns
        -------
        Optional[:class:`InteractionCallbackResponse`]
            The interaction callback data, or ``None`` if editing the message was not possible.
        Nr   )	rR   r   r   r   r   r   r  r   rM  rP  rQ  rg  rh  c                   K   t          j        |            d {V  	 j                                         d {V  d S # t          $ r Y d S w xY wr3  rj  rm  s    r|   rn  z4InteractionResponse.edit_message.<locals>.inner_call  ro  rp  rq  )#rB  r   r)  rV   re   rQ   rR   r   r   r   rO   prevent_view_updates_forr   r   r[  r"   r   r%   r   message_updater   r   rx   rT  rX   rg   r   r   r/   r  r	  r
  r,  rk  ru  )r{   r   r   r   r   r   r   r]  r[  r0  msgrt   r,  rM  r   r  rx   rT   r   rn  s   `                   r|   edit_messagez InteractionResponse.edit_message`  s3     Z  	5&t|444n?JJJ;8/:VWWWFw:#9**:666')) ,Q//E$3E!!E#%%4(7=#&,m&D-

 

 

 }!88ILO* 9 
 
 
 
 
 
 
 
 6D.<,%$	
 
 
  	F((** 	Ft/C/C/E/E 	FT:#D1DEEE#0<        

---r~   modalrC   c               4  K   | j         rt          | j                  | j        }t          j                    }|j        j        }t          t          j	        j
        |                                          }|                    |j        |j        |j        |j        |j        |           d{V }|                                s| j        j                            |           t          j	        | _         t)          || j        | j        j        | j                   S )a^  |coro|

        Responds to this interaction by sending a modal.

        .. versionchanged:: 2.5
            This now returns a :class:`InteractionCallbackResponse` instance.

        Parameters
        -----------
        modal: :class:`~discord.ui.Modal`
            The modal to send.

        Raises
        -------
        HTTPException
            Sending the modal failed.
        InteractionResponded
            This interaction has already been responded to before.

        Returns
        -------
        :class:`InteractionCallbackResponse`
            The interaction callback data.
        rP  NrQ  )rB  r   r)  r"   r   re   rx   r$   r   r|  r   to_dictrT  rQ   rX   rg   r   r   r  r
  r/   )r{   r|  r0  r   rx   r  r   s          r|   
send_modalzInteractionResponse.send_modal  s      2  	5&t|444#%%}!,-D-J-PRWR_R_RaRabb <<ILO* = 
 
 
 
 
 
 
 
   "" 	2L**51115;*<,%$	
 
 
 	
r~   choicesSequence[Choice[ChoiceT]]c                4  K   | j         rt          | j                  | j        j        j        $| j        j        dfd|D              d{V i}ndd |D             i}| j        }|j        t          j        urt          d          t          j                    }|j        j        }t          t          j        j        |          }|                    |j        |j        |j        |j        |j        |           d{V  t          j        | _         dS )a  |coro|

        Responds to this interaction by giving the user the choices they can use.

        Parameters
        -----------
        choices: List[:class:`~discord.app_commands.Choice`]
            The list of new choices as the user is typing.

        Raises
        -------
        HTTPException
            Sending the choices failed.
        ValueError
            This interaction cannot respond with autocomplete.
        InteractionResponded
            This interaction has already been responded to before.
        Nr  c                L   K   g | ]}|                                d {V S r3  )!get_translated_payload_for_locale)r   optionr  user_locales     r|   r   z4InteractionResponse.autocomplete.<locals>.<listcomp>A  sA      zzzhn&"J"J:Wb"c"ccccccczzzr~   c                6    g | ]}|                                 S r   )r~  )r   r  s     r|   r   z4InteractionResponse.autocomplete.<locals>.<listcomp>E  s"    CCCFNN,,CCCr~   z5cannot respond to this interaction with autocomplete.rO  rP  )rB  r   r)  re   r  rZ   rR   r   r   
ValueErrorr"   r   rx   r$   r   autocomplete_resultr   rT  rQ   rX   rg   r   r   )	r{   r  r   r0  r   rx   r  r  r  s	          @@r|   r   z InteractionResponse.autocomplete'  s\     &  	5&t|444\(4
!,-Kzzzzzryzzzzzzzzz'GG
 CC7CCC'G ;o:::TUUU#%%}!,2I2]2cjqrrr11ILO* 2 
 
 	
 	
 	
 	
 	
 	
 	
 6Ir~   c                  K   | j         rt          | j                  | j        }t          j                    }|j        j        }t          t          j	        j
                  }|                    |j        |j        |j        |j        |j        |           d{V }t          j	        | _         t#          || j        | j        j        | j                   S )a  |coro|

        Responds to this interaction by launching the activity associated with the app.
        Only available for apps with activities enabled.

        .. versionadded:: 2.6

        Raises
        -------
        HTTPException
            Launching the activity failed.
        InteractionResponded
            This interaction has already been responded to before.

        Returns
        -------
        :class:`InteractionCallbackResponse`
            The interaction callback data.
        rP  NrQ  )rB  r   r)  r"   r   re   rx   r$   r   launch_activityr   rT  rQ   rX   rg   r   r   r/   )r{   r0  r   rx   r  r   s         r|   r  z#InteractionResponse.launch_activityZ  s      (  	5&t|444#%%}!,-D-T-Z[[ <<ILO* = 
 
 
 
 
 
 
 
 6E*<,%$	
 
 
 	
r~   )r0  r1  r  )r   rG  )rI  r   rJ  r   r   rK  r  )rZ  r:   r  r^  r   r@   rI  r   r   r;   r[  r   r\  r   r]  r_  r   r`  r3  )r   rd  r   r=   r   r   rZ  r:   r  r^  r   r?   rc  r   rI  r   r   r;   r[  r   r\  r   r]  r_  r   rN   r   r`  )r   rd  r   r=   r   r   rZ  r:   r  r^  r   r>   rc  r   rI  r   r   r;   r[  r   r\  r   r]  r_  r   rN   r   r`  )r   rd  r   r   r   r   r   r   r   r  r   r  r]  r_  r[  r   r   rK  )r|  rC   r   r`  )r  r  r   r  )r   r`  )r   r  r  r   rr   r!  r}   rF  r"  rR   rV  rY  r   rO   rb  r{  r  r   r  r   r~   r|   r.   r.     s;         "I    
F F F F/ / / / # # # X#  	S S S S S Sj? ? ? ?@   ',3 %(,3 3 3 3 3 X3  "&3 ") ',3 %(,3 3 3 3 3 X3( "&Q ") ' ,3 %(,Q Q Q Q Q Ql ")!(")9@296=(, 'P P P P P Pd3
 3
 3
 3
j1J 1J 1J 1Jf,
 ,
 ,
 ,
 ,
 ,
r~   r.   c                  P    e Zd ZdZddZd Zdd	ddZd Zed             Z	d Z
dS )r   )r)  _interactionr7  r,   r0  r9   c                "    || _         || _        d S r3  )r  r)  )r{   r7  r0  s      r|   r}   z!_InteractionMessageState.__init__  s    )4(.r~   c                6    | j                             |          S r3  )r)  r   )r{   rS   s     r|   r   z#_InteractionMessageState._get_guild  s    |&&x000r~   Tcacher  r   c               :    | j                             ||          S )Nr  )r)  
store_user)r{   rT   r  s      r|   r  z#_InteractionMessageState.store_user  s    |&&t5&999r~   c                6    | j                             |          S r3  )r)  create_userr   s     r|   r  z$_InteractionMessageState.create_user  s    |''---r~   c                    | j         j        S r3  )r)  rx   r   s    r|   rx   z_InteractionMessageState.http  s    |  r~   c                ,    t          | j        |          S r3  )r   r)  )r{   attrs     r|   __getattr__z$_InteractionMessageState.__getattr__  s    t|T***r~   N)r7  r,   r0  r9   )r  r   )r   r  r  rr   r}   r   r  r  r"  rx   r  r   r~   r|   r   r     s        +I/ / / /1 1 1 15 : : : : : :. . . ! ! X!+ + + + +r~   r   c            
          e Zd ZU dZdZded<   eedddd'd            Zeeeeeeddedd(d            Zeeeeeddedd)dZd*d Z	d+d"Z
dd#d,d&ZdS )-r-   ag  Represents the original interaction response message.

    This allows you to edit or delete the message associated with
    the interaction response. To retrieve this object see :meth:`Interaction.original_response`.

    This inherits from :class:`discord.Message` with changes to
    :meth:`edit` and :meth:`delete` to work.

    .. versionadded:: 2.0
    r   r   re   N)r   r   r]  r   r   r   r@   r   r  r]  r_  r   c               
   K   d S r3  r   )r{   r   r   r   r]  s        r|   editzInteractionMessage.edit  s       !Sr~   )r   r   r   r   r   r   r]  r   r   r   r   r   r   r   Optional[View]r   rN   c               
   K   d S r3  r   )	r{   r   r   r   r   r   r   r]  r   s	            r|   r  zInteractionMessage.edit  s       !Sr~   r  c          	        K   | j         j                            |||||||           d{V }	||                     |           d{V  |	S )a	  |coro|

        Edits the message.

        Parameters
        ------------
        content: Optional[:class:`str`]
            The content to edit the message with or ``None`` to clear it.
        embeds: List[:class:`Embed`]
            A list of embeds to edit the message with.
        embed: Optional[:class:`Embed`]
            The embed to edit the message with. ``None`` suppresses the embeds.
            This should not be mixed with the ``embeds`` parameter.
        attachments: List[Union[:class:`Attachment`, :class:`File`]]
            A list of attachments to keep in the message as well as new files to upload. If ``[]`` is passed
            then all attachments are removed.

            .. note::

                New files will always appear after current attachments.

        allowed_mentions: :class:`AllowedMentions`
            Controls the mentions being processed in this message.
            See :meth:`.abc.Messageable.send` for more information.
        view: Optional[Union[:class:`~discord.ui.View`, :class:`~discord.ui.LayoutView`]]
            The updated view to update this message with. If ``None`` is passed then
            the view is removed.

            .. note::

                If you want to update the message to have a :class:`~discord.ui.LayoutView`, you must
                explicitly set the ``content``, ``embed``, ``embeds``, and ``attachments`` parameters to
                ``None`` if the previous message had any.
        delete_after: Optional[:class:`float`]
            If provided, the number of seconds to wait in the background
            before deleting the message we just sent. If the deletion fails,
            then it is silently ignored.

            .. versionadded:: 2.2
        poll: :class:`~discord.Poll`
            The poll to create when editing the message.

            .. versionadded:: 2.5

            .. note::

                This is only accepted if the interaction response's :attr:`InteractionResponse.type`
                attribute is :attr:`InteractionResponseType.deferred_channel_message`.

        Raises
        -------
        HTTPException
            Editing the message failed.
        Forbidden
            Edited a message that is not yours.
        TypeError
            You specified both ``embed`` and ``embeds``
        ValueError
            The length of ``embeds`` was invalid.

        Returns
        ---------
        :class:`InteractionMessage`
            The newly edited message.
        r   Nrg  )re   r  r  delete)
r{   r   r   r   r   r   r   r]  r   ress
             r|   r  zInteractionMessage.edit  s      Z K,CC#- D 
 
 
 
 
 
 
 
 #++L+111111111
r~   r  r:   c                P   K   |                      g | j        |           d{V S )a  |coro|

        Adds new files to the end of the message attachments.

        .. versionadded:: 2.0

        Parameters
        -----------
        \*files: :class:`File`
            New files to add to the message.

        Raises
        -------
        HTTPException
            Editing the message failed.
        Forbidden
            Tried to edit a message that isn't yours.

        Returns
        ---------
        :class:`InteractionMessage`
            The newly edited message.
        r   Nr  r   )r{   r  s     r|   	add_fileszInteractionMessage.add_files"  s<      0 YY+FT-=+F+FYGGGGGGGGGr~   r   c                b   K   |                      fd| j        D                        d{V S )a  |coro|

        Removes attachments from the message.

        .. versionadded:: 2.0

        Parameters
        -----------
        \*attachments: :class:`Attachment`
            Attachments to remove from the message.

        Raises
        -------
        HTTPException
            Editing the message failed.
        Forbidden
            Tried to edit a message that isn't yours.

        Returns
        ---------
        :class:`InteractionMessage`
            The newly edited message.
        c                    g | ]}|v|	S r   r   )r   ar   s     r|   r   z9InteractionMessage.remove_attachments.<locals>.<listcomp>T  s$    +`+`+`!1T_K_K_AK_K_K_r~   r  Nr  )r{   r   s    `r|   remove_attachmentsz%InteractionMessage.remove_attachments<  sG      0 YY+`+`+`+`t7G+`+`+`Yaaaaaaaaar~   r  rg  r  c                   K   |&|fd fd}t          j         |                       dS  j        j                                         d{V  dS )a  |coro|

        Deletes the message.

        Parameters
        -----------
        delay: Optional[:class:`float`]
            If provided, the number of seconds to wait before deleting the message.
            The waiting is done in the background and deletion failures are ignored.

        Raises
        ------
        Forbidden
            You do not have proper permissions to delete the message.
        NotFound
            The message was deleted already.
        HTTPException
            Deleting the message failed.
        Nrg  rh  c                   K   t          j        |            d {V  	 j        j                                         d {V  d S # t
          $ r Y d S w xY wr3  )rk  rl  re   r  r  r   rm  s    r|   rn  z-InteractionMessage.delete.<locals>.inner_callm  s      mE*********+2KKMMMMMMMMMMM$   DDs   $A 
AArq  )rk  ru  re   r  r  )r{   rg  rn  s   `  r|   r  zInteractionMessage.deleteV  s      * 05        

-----+*CCEEEEEEEEEEEr~   )
r   r   r   r@   r   r  r]  r_  r   r-   )r   r   r   r   r   r   r   r   r   r  r   r  r]  r_  r   rN   r   r-   )r   r   r   r   r   r   r   r   r   r  r   r  r]  r_  r   rN   r   r-   )r  r:   r   r-   )r   r   r   r-   )rg  r_  r   r  )r   r  r  r   rr   r!  r   rO   r  r  r  r  r   r~   r|   r-   r-     sE        	 	 I$$$$ :A6:(,! ! ! ! ! X!  ")")!(9@&6:(,! ! ! ! ! X!  ")")!(9@296:(,X X X X X XtH H H H4b b b b4 8<  F  F  F  F  F  F  F  Fr~   r-   )zr   
__future__r   r   typingr   r   r   r   r   r	   r
   r   r   r   rk  r    r   enumsr   r   r   r   errorsr   r   r   r   rM  r   rl   r   _typesr   skur   rW   r   r   r   rV   r   r   r   r    rx   r!   webhook.async_r"   r#   r$   r%   app_commands.installsr&   app_commands.namespacer'   app_commands.translatorr(   r)   r*   r+   __all__types.interactionsr,   rs   r1   r2   r3   r/  r4   r&  r5   r6   types.webhookWebhookPayloadtypes.snowflaker7   r   r8   rt   r9   rZ  r:   mentionsr;   aiohttpr<   r   r=   ui.viewr>   r?   r@   app_commands.modelsrA   rB   ui.modalrC   rD   rE   rF   rG   rH   rI   rJ   threadsrK   app_commands.commandsrL   rM   r   rN   InteractionChannelInteractionCallbackResourcerO   r!  r0   r/   r.   r   r-   r   r~   r|   <module>r     s_    0 # " " " " "  f f f f f f f f f f f f f f f f f f f f f f f f         M M M M M M M M M M M M Z Z Z Z Z Z Z Z Z Z Z Z                                           ( ( ( ( ( ( ( ( $ $ $ $ $ $ + + + + + + t t t t t t t t t t t t 4 4 4 4 4 4 - - - - - - _ _ _ _ _ _ _ _ _ _ . . . . . .  )                       +*****&&&&&&))))))%%%%%%333333333344444444xxxxxxxxxxxxxxxxxx;;;;;;;;		 #(	/#
 }    F	R F	R F	R F	R F	R''" F	R F	R F	RR" " " " " " " ""R R R R R''"2 R R Rjl	
 l	
 l	
 l	
 l	
''* l	
 l	
 l	
^+ + + + + + + +0UF UF UF UF UF UF UF UF UF UFr~   