
    i                        d Z ddlmZ ddlmZmZmZmZmZ dZ	erddl
mZ ddlmZmZ  G d d	          Z G d
 d          ZdS )a:  
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.
    )annotations)TYPE_CHECKINGClassVarListOptionalSequence)AppInstallationTypeAppCommandContext)Self   )InteractionContextTypeInteractionInstallationTypec                      e Zd ZU dZdZdZded<   dZded<   ddd	d"dZd Z	e
d#d            Zej        d$d            Ze
d#d            Zej        d$d            Zd%dZd#dZd&dZed'd            Zd(d!ZdS ))r	   a+  Represents the installation location of an application command.

    .. versionadded:: 2.4

    Parameters
    -----------
    guild: Optional[:class:`bool`]
        Whether the integration is a guild install.
    user: Optional[:class:`bool`]
        Whether the integration is a user install.
    _guild_userr   ClassVar[int]GUILD   USERNguilduserr   Optional[bool]r   c               "    || _         || _        d S Nr   )selfr   r   s      ^/usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/discord/app_commands/installs.py__init__zAppInstallationType.__init__8   s    &+%)


    c                (    d| j         d| j        dS )Nz<AppInstallationType guild=z user=>r   r   s    r   __repr__zAppInstallationType.__repr__<   s    OTZOOOOOOr    returnboolc                *    t          | j                  S )z::class:`bool`: Whether the integration is a guild install.r&   r   r#   s    r   r   zAppInstallationType.guild?        DK   r    valueNonec                .    t          |          | _        d S r   r(   r   r*   s     r   r   zAppInstallationType.guildD       5kkr    c                *    t          | j                  S )z9:class:`bool`: Whether the integration is a user install.r&   r   r#   s    r   r   zAppInstallationType.userH   s     DJr    c                .    t          |          | _        d S r   r0   r-   s     r   r   zAppInstallationType.userM   s    %[[


r    otherc                x    |j         | j         n|j         }|j        | j        n|j        }t          ||          S )Nr   )r   r   r	   )r   r2   r   r   s       r   mergezAppInstallationType.mergeQ   s?      %|3"[0tzzek"T::::r    c                L    t          d | j        | j        fD                       S )Nc              3     K   | ]}|d u V  	d S r    .0xs     r   	<genexpr>z0AppInstallationType._is_unset.<locals>.<genexpr>Y   s&      @@19@@@@@@r    )allr   r   r#   s    r   	_is_unsetzAppInstallationType._is_unsetX   s(    @@t{DJ&?@@@@@@r    Optional[AppInstallationType]+Optional[List[InteractionInstallationType]]c                    ||                      |          n| }|                                rd S |                                S r   r4   r=   to_arrayr   r2   results      r   _merge_to_arrayz#AppInstallationType._merge_to_array[   F    &+&7E"""T 	4   r    %Sequence[InteractionInstallationType]r   c                n     |             }|D ]'}|| j         k    rd|_        || j        k    rd|_        (|S NT)r   r   r   r   clsr*   r   r:   s       r   _from_valuezAppInstallationType._from_valuea   sH    suu 	" 	"ACI~~"ch!
r    !List[InteractionInstallationType]c                    g }| j         r|                    | j                   | j        r|                    | j                   |S r   )r   appendr   r   r   r   valuess     r   rB   zAppInstallationType.to_arrayk   sH    ; 	&MM$*%%%: 	%MM$)$$$r    )r   r   r   r   r%   r&   r*   r&   r%   r+   )r2   r	   r%   r	   )r2   r>   r%   r?   )r*   rG   r%   r   )r%   rM   )__name__
__module____qualname____doc__	__slots__r   __annotations__r   r   r$   propertyr   setterr   r4   r=   rE   classmethodrL   rB   r7   r    r   r	   r	   &   sv        
 
 $IED26t * * * * * *P P P ! ! ! X! \" " " \"       X  
[! ! ! [!; ; ; ;A A A A! ! ! !    [     r    r	   c                  B   e Zd ZU dZdZded<   dZded<   dZded<   d	Zd
d
d
dd(dZ	d)dZ
ed*d            Zej        d+d            Zed*d            Zej        d+d            Zed*d            Zej        d+d            Zd,dZd*dZd-d"Zed.d%            Zd/d'Zd
S )0r
   a  Wraps up the Discord :class:`~discord.app_commands.Command` execution context.

    .. versionadded:: 2.4

    Parameters
    -----------
    guild: Optional[:class:`bool`]
        Whether the context allows usage in a guild.
    dm_channel: Optional[:class:`bool`]
        Whether the context allows usage in a DM channel.
    private_channel: Optional[:class:`bool`]
        Whether the context allows usage in a DM or a GDM channel.
    r   r   r   r   
DM_CHANNELr   PRIVATE_CHANNELr   _dm_channel_private_channelNr   
dm_channelprivate_channelr   r   rd   re   c               0    || _         || _        || _        d S r   r`   )r   r   rd   re   s       r   r   zAppCommandContext.__init__   s!     ',+50?r    r%   strc                8    d| j         d| j        d| j        dS )Nz<AppCommandContext guild=z dm_channel=z private_channel=r"   rc   r#   s    r   r$   zAppCommandContext.__repr__   sF     C4:  C  CT_  C  Cimi}  C  C  C  	Cr    r&   c                *    t          | j                  S )z;:class:`bool`: Whether the context allows usage in a guild.r(   r#   s    r   r   zAppCommandContext.guild   r)   r    r*   r+   c                .    t          |          | _        d S r   r(   r-   s     r   r   zAppCommandContext.guild   r.   r    c                *    t          | j                  S )z@:class:`bool`: Whether the context allows usage in a DM channel.r&   ra   r#   s    r   rd   zAppCommandContext.dm_channel   s     D$%%%r    c                .    t          |          | _        d S r   rl   r-   s     r   rd   zAppCommandContext.dm_channel   s    ;;r    c                *    t          | j                  S )zI:class:`bool`: Whether the context allows usage in a DM or a GDM channel.r&   rb   r#   s    r   re   z!AppCommandContext.private_channel   s     D)***r    c                .    t          |          | _        d S r   ro   r-   s     r   re   z!AppCommandContext.private_channel   s     $Ur    r2   c                    |j         | j         n|j         }|j        | j        n|j        }|j        | j        n|j        }t          |||          S )Nrc   )r   ra   rb   r
   )r   r2   r   rd   re   s        r   r4   zAppCommandContext.merge   s]    $|3).):)BT%%HY
383I3Q$//W\Wm uUdeeeer    c                X    t          d | j        | j        | j        fD                       S )Nc              3     K   | ]}|d u V  	d S r   r7   r8   s     r   r;   z.AppCommandContext._is_unset.<locals>.<genexpr>   s&      ]]19]]]]]]r    )r<   r   ra   rb   r#   s    r   r=   zAppCommandContext._is_unset   s.    ]]t{D4DdF[&\]]]]]]r    Optional[AppCommandContext]&Optional[List[InteractionContextType]]c                    ||                      |          n| }|                                rd S |                                S r   rA   rC   s      r   rE   z!AppCommandContext._merge_to_array   rF   r     Sequence[InteractionContextType]r   c                     |             }|D ]:}|| j         k    rd|_        || j        k    rd|_        (|| j        k    rd|_        ;|S rI   )r   r   r^   ra   r_   rb   rJ   s       r   rL   zAppCommandContext._from_value   sd    suu 	- 	-ACI~~"cn$$#'  c)))(,%r    List[InteractionContextType]c                    g }| j         r|                    | j                   | j        r|                    | j                   | j        r|                    | j                   |S r   )r   rO   r   ra   r^   rb   r_   rP   s     r   rB   zAppCommandContext.to_array   si    ; 	&MM$*%%% 	+MM$/***  	0MM$.///r    )r   r   rd   r   re   r   )r%   rg   rR   rS   )r2   r
   r%   r
   )r2   rt   r%   ru   )r*   rw   r%   r   )r%   ry   )rT   rU   rV   rW   r   rY   r^   r_   rX   r   r$   rZ   r   r[   rd   re   r4   r=   rE   r\   rL   rB   r7   r    r   r
   r
   t   s          E !J!!!!%&O&&&&=I
 !%%)*.	@ 	@ 	@ 	@ 	@ 	@C C C C ! ! ! X! \" " " \" & & & X& ' ' ' ' + + + X+ , , , ,f f f f^ ^ ^ ^! ! ! ! 	 	 	 [	     r    r
   N)rW   
__future__r   typingr   r   r   r   r   __all__typing_extensionsr   types.interactionsr   r   r	   r
   r7   r    r   <module>r      s    0 # " " " " " D D D D D D D D D D D D D D
  Y&&&&&&XXXXXXXXK K K K K K K K\a a a a a a a a a ar    