
    i                       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mZmZ ddl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 ddlmZ ddlm Z  dd	l!m"Z" erdd
l#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l0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z: ddl;m<Z<m=Z= ddl>m?Z?m@Z@mAZA ddlBmCZC ddlDmEZE ddlFmGZG ddlHmIZI ddlJmKZK ddlLmMZM  edeN          ZOdZPejQ        jR        ZRd eSd!<    ed"          ZT ed#d$          ZUer e%d%          ZVn ed%          ZVd.d)ZW G d* d+e	e"                   ZX G d, d-ejY        jZ        e	e"                   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.
    )annotationsN)TYPE_CHECKINGAnyDict	GeneratorGenericListOptionalTypeVarUnionSequenceTypeoverload)	InteractionMessage
AttachmentMessageTypeUserPartialMessageablePermissionsChannelTypeThread)Typing   )
StringView)BotT)Self	ParamSpec	TypeGuard)MessageableChannel)Guild)Member)ConnectionState)
ClientUser)VoiceProtocol)Embed)File)AllowedMentions)GuildStickerStickerItem)MessageReferencePartialMessage)BaseViewView
LayoutView)!ApplicationCommandInteractionData)Poll)Cog)Command)	Parameter)TracebackTypeBE)bound)Contextr   MISSINGTCogTr2   PobjreturnTypeGuard[Cog]c                "    t          | d          S )N__cog_commands__)hasattr)r=   s    ]/usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/discord/ext/commands/context.pyis_cogrD   R   s    3*+++    c                  6    e Zd ZddZddZdd
ZddZddZdS )DeferTypingctxContext[BotT]	ephemeralboolc               "    || _         || _        d S N)rH   rJ   )selfrH   rJ   s      rC   __init__zDeferTyping.__init__W   s    "%(rE   r>   Nonec                   K   | j         j        rU| j         j        j                                        s4| j         j        j                            | j                   d {V  d S d S d S )NrJ   )rH   interactionresponseis_donedeferrJ   rN   s    rC   do_deferzDeferTyping.do_defer[   s      8 	P(<(E(M(M(O(O 	P(&/555OOOOOOOOOOO	P 	P 	P 	PrE   Generator[Any, None, None]c                N    |                                                                  S rM   )rX   	__await__rW   s    rC   r[   zDeferTyping.__await___   s    }}((***rE   c                >   K   |                                   d {V  d S rM   )rX   rW   s    rC   
__aenter__zDeferTyping.__aenter__b   s,      mmoorE   exc_typeOptional[Type[BE]]excOptional[BE]	tracebackOptional[TracebackType]c                
   K   d S rM    )rN   r^   r`   rb   s       rC   	__aexit__zDeferTyping.__aexit__e   s       	rE   N)rH   rI   rJ   rK   )r>   rP   )r>   rY   )r^   r_   r`   ra   rb   rc   r>   rP   )__name__
__module____qualname__rO   rX   r[   r]   rf   re   rE   rC   rG   rG   V   s|        ) ) ) )P P P P+ + + +        rE   rG   c                      e Zd ZdZeedddedddddddddZedd#            Zdd(Zdd)d*dd.Z	e
dd/            Zdd1Ze
dd3            Ze
dd5            Ze
dd7            Zej        j        dd9            Zej        j        dd;            Zej        j        dd=            Zej        j        dd?            Zej        j        ddA            Zej        j        ddB            Ze
ddD            ZddFZedGdGdGdGdGdGdGdGdGdH	ddX            ZedGdGdGdGdGdGdGdGdGdY	dd\            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGd]ddg            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdhddi            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdjddm            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdnddo            ZdddpZddqddsZddqddtZedGdGdGdGdGdGdGdGdGdH	ddu            ZedGdGdGdGdGdGdGdGdGdY	ddv            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGd]ddw            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdhddx            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdjddy            Ze	 ddGdGdGdGdGdGdGdGdGdGdGdGdGdGdnddz            Z	 dddddddddddddddddd{d fdZ xZ S )r8   a{  Represents the context in which a command is being invoked under.

    This class contains a lot of meta data to help you understand more about
    the invocation context. This class is not created manually and is instead
    passed around to commands as the first parameter.

    This class implements the :class:`~discord.abc.Messageable` ABC.

    Attributes
    -----------
    message: :class:`.Message`
        The message that triggered the command being executed.

        .. note::

            In the case of an interaction based context, this message is "synthetic"
            and does not actually exist. Therefore, the ID on it is invalid similar
            to ephemeral messages.
    bot: :class:`.Bot`
        The bot that contains the command being executed.
    args: :class:`list`
        The list of transformed arguments that were passed into the command.
        If this is accessed during the :func:`.on_command_error` event
        then this list could be incomplete.
    kwargs: :class:`dict`
        A dictionary of transformed arguments that were passed into the command.
        Similar to :attr:`args`\, if this is accessed in the
        :func:`.on_command_error` event then this dict could be incomplete.
    current_parameter: Optional[:class:`Parameter`]
        The parameter that is currently being inspected and converted.
        This is only of use for within converters.

        .. versionadded:: 2.0
    current_argument: Optional[:class:`str`]
        The argument string of the :attr:`current_parameter` that is currently being converted.
        This is only of use for within converters.

        .. versionadded:: 2.0
    interaction: Optional[:class:`~discord.Interaction`]
        The interaction associated with this context.

        .. versionadded:: 2.0
    prefix: Optional[:class:`str`]
        The prefix that was used to invoke the command. For interaction based contexts,
        this is ``/`` for slash commands and ``\u200b`` for context menu commands.
    command: Optional[:class:`Command`]
        The command that is being invoked currently.
    invoked_with: Optional[:class:`str`]
        The command name that triggered this invocation. Useful for finding out
        which alias called the command.
    invoked_parents: List[:class:`str`]
        The command names of the parents that triggered this invocation. Useful for
        finding out which aliases called the command.

        For example in commands ``?a b c test``, the invoked parents are ``['a', 'b', 'c']``.

        .. versionadded:: 1.7

    invoked_subcommand: Optional[:class:`Command`]
        The subcommand that was invoked.
        If no valid subcommand was invoked then this is equal to ``None``.
    subcommand_passed: Optional[:class:`str`]
        The string that was attempted to call a subcommand. This does not have
        to point to a valid registered subcommand and could just point to a
        nonsense string. If nothing was passed to attempt a call to a
        subcommand then this is set to ``None``.
    command_failed: :class:`bool`
        A boolean that indicates if the command failed to be parsed, checked,
        or invoked.
    NF)argskwargsprefixcommandinvoked_withinvoked_parentsinvoked_subcommandsubcommand_passedcommand_failedcurrent_parametercurrent_argumentrS   messager   botr   viewr   rk   	List[Any]rl   Dict[str, Any]rm   Optional[str]rn    Optional[Command[Any, ..., Any]]ro   rp   	List[str]rq   rr   rs   rK   rt   Optional[Parameter]ru   rS   Optional[Interaction[BotT]]c                  || _         || _        |pg | _        |pi | _        || _        || _        || _        || _        |	pg | _        |
| _	        || _
        || _        || _        || _        || _        | j         j        | _        d S rM   )rv   rw   rk   rl   rm   rn   rx   ro   rp   rq   rr   rs   rt   ru   rS   _state)rN   rv   rw   rx   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rS   s                   rC   rO   zContext.__init__   s    & !(#zr	&,l%+9@ $	+7*9*?RDV0A$26G/?8C'+|':rE   Interaction[BotT]r>   r   c                 K   ddl m} t          |j        |          st	          d          |j        }|t          d          |j        }|j        }|                    dd          }|j	        |j
        g g dddd|dk    rt          j        j        nt          j        j        dd	g g g d
}|j        t!          d          |j        p t%          |j        |j        |j                  }t+          |j        ||          }	|j        |	_        d |j        D             |	_        n|j	        }	|dk    rdnd}
 | |	|t5          d	          g i |
||j        |	  	        }||_        |j        |_        |S )a  |coro|

        Creates a context from a :class:`discord.Interaction`. This only
        works on application command based interactions, such as slash commands
        or context menus.

        On slash command based interactions this creates a synthetic :class:`~discord.Message`
        that points to an ephemeral message that the command invoker has executed. This means
        that :attr:`Context.author` returns the member that invoked the command.

        In a message context menu based interaction, the :attr:`Context.message` attribute
        is the message that the command is being executed on. This means that :attr:`Context.author`
        returns the author of the message being targetted. To get the member that invoked
        the command then :attr:`discord.Interaction.user` should be used instead.

        .. versionadded:: 2.0

        Parameters
        -----------
        interaction: :class:`discord.Interaction`
            The interaction to create a context with.

        Raises
        -------
        ValueError
            The interaction does not have a valid command.
        TypeError
            The interaction client is not derived from :class:`Bot` or :class:`AutoShardedBot`.
        r   )BotBasezNInteraction client is not derived from commands.Bot or commands.AutoShardedBotNz&interaction does not have command datatypeF@    )id	reactionsembedsmention_everyonettspinnededited_timestampr   flagscontentmentionsmention_rolesattachmentsz>interaction channel ID is null, this is probably a Discord bug)stateguild_idr   )r   channeldatac                B    g | ]\  }}t          |t                    |S re   )
isinstancer   ).0_as      rC   
<listcomp>z,Context.from_interaction.<locals>.<listcomp>   s-    "d"d"dA*UVXbJcJc"d1"d"d"drE   /u   ​)	rv   rw   rx   rk   rl   rm   rS   ro   rn   )rw   r   r   client	TypeErrorrn   
ValueErrorr   getrv   r   r   chat_input_commandvaluecontext_menu_command
channel_idRuntimeErrorr   r   r   r   r   userauthor	namespacer   r   name_batonrs   )clsrS   r   rn   rw   r   type_synthetic_payloadr   rv   rm   rH   s               rC   from_interactionzContext.from_interaction   s     B 	!     +,g66 	nlmmm%?EFFF&2=2B##&!n$)$(@E

6<<P[PpPv!#!! !  %-"#cddd!) -?!(;3GKLb. . .G K$6N_```G(-GN"d"d1F"d"d"dG!)G

cB# 

 

 

 !(7
rE   Command[CogT, P, T]P.argsP.kwargsr:   c               *   K    || g|R i | d{V S )a  |coro|

        Calls a command with the arguments given.

        This is useful if you want to just call the callback that a
        :class:`.Command` holds internally.

        .. note::

            This does not handle converters, checks, cooldowns, pre-invoke,
            or after-invoke hooks in any matter. It calls the internal callback
            directly as-if it was a regular function.

            You must take care in passing the proper arguments when
            using this function.

        .. versionchanged:: 2.0

            ``command`` parameter is now positional-only.

        Parameters
        -----------
        command: :class:`.Command`
            The command that is going to be called.
        \*args
            The arguments to use.
        \*\*kwargs
            The keyword arguments to use.

        Raises
        -------
        TypeError
            The command argument to invoke is missing.
        Nre   )rN   rn   rk   rl   s       rC   invokezContext.invoke4  s;      F WT3D333F333333333rE   T)
call_hooksrestartr   r   rP   c               F  K   | j         }| j        }|t          d          |j        |j        }}| j        }| j        }| j        }	| j        }
|rL|j	        p|}t          | j        pd          |_        d|_        g | _        |                                | _        n|}	 |                    | |           d{V  || _         ||_        ||_        || _        || _        |	| _        |
| _        dS # || _         ||_        ||_        || _        || _        |	| _        |
| _        w xY w)a  |coro|

        Calls the command again.

        This is similar to :meth:`~.Context.invoke` except that it bypasses
        checks, cooldowns, and error handlers.

        .. note::

            If you want to bypass :exc:`.UserInputError` derived exceptions,
            it is recommended to use the regular :meth:`~.Context.invoke`
            as it will work more naturally. After all, this will end up
            using the old arguments the user has used and will thus just
            fail again.

        Parameters
        ------------
        call_hooks: :class:`bool`
            Whether to call the before and after invoke hooks.
        restart: :class:`bool`
            Whether to start the call chain from the very beginning
            or where we left off (i.e. the command that caused the error).
            The default is to start where we left off.

        Raises
        -------
        ValueError
            The context to reinvoke is not valid.
        NzThis context is not valid.r   r   )r   )rn   rx   r   indexpreviousro   rq   rp   rr   root_parentlenrm   get_wordreinvoke)rN   r   r   cmdrx   r   r   ro   rq   rp   rr   to_calls               rC   r   zContext.reinvokeY  s[     < ly;9::: *dmx(!4. 2 	o,GT[.B//DJDM#%D  $DG		7""4J"?????????DLDJ$DM ,D&8D##2D %6D""" DLDJ$DM ,D&8D##2D %6D"6666s   C- -3D c                &    | j         duo| j        duS )zL:class:`bool`: Checks if the invocation context is valid to be invoked with.N)rm   rn   rW   s    rC   validzContext.valid  s     {$&C4<t+CCrE   discord.abc.Messageablec                   K   | j         S rM   )r   rW   s    rC   _get_channelzContext._get_channel  s      |rE   strc                    | j         dS | j        }t          j        d|j        z            }|                    d|j                            dd          z  | j                   S )z:class:`str`: The cleaned up invoke prefix. i.e. mentions are ``@name`` instead of ``<@id>``.

        .. versionadded:: 2.0
        Nr   z<@!?%s>z@%s\z\\)rm   merecompiler   subdisplay_namereplace)rN   r   patterns      rC   clean_prefixzContext.clean_prefix  s^     ;2w
 *Z$'122{{54#4#<#<T5#I#II4;WWWrE   Optional[Cog]c                ,    | j         dS | j         j        S )zkOptional[:class:`.Cog`]: Returns the cog associated with this context's command. None if it does not exist.N)rn   cogrW   s    rC   r   zContext.cog  s     <4|rE   intc                J    | j         | j         j        nt          j        j        S )z:class:`int`: Returns the maximum number of bytes files can have when uploaded to this guild or DM channel associated with this context.

        .. versionadded:: 2.3
        )guildfilesize_limitdiscordutilsDEFAULT_FILE_SIZE_LIMIT_BYTESrW   s    rC   r   zContext.filesize_limit  s      -1J,Btz((HssrE   Optional[Guild]c                    | j         j        S )zkOptional[:class:`.Guild`]: Returns the guild associated with this context's command. None if not available.)rv   r   rW   s    rC   r   zContext.guild  s     |!!rE   r    c                    | j         j        S )zUnion[:class:`.abc.Messageable`]: Returns the channel associated with this context's command.
        Shorthand for :attr:`.Message.channel`.
        )rv   r   rW   s    rC   r   zContext.channel  s    
 |##rE   Union[User, Member]c                    | j         j        S )zUnion[:class:`~discord.User`, :class:`.Member`]:
        Returns the author associated with this context's command. Shorthand for :attr:`.Message.author`
        )rv   r   rW   s    rC   r   zContext.author  s    
 |""rE   Union[Member, ClientUser]c                @    | j         | j         j        n| j        j        S )zUnion[:class:`.Member`, :class:`.ClientUser`]:
        Similar to :attr:`.Guild.me` except it may return the :class:`.ClientUser` in private message contexts.
        )r   r   rw   r   rW   s    rC   r   z
Context.me  s     !%
 6tz}}DHMIrE   r   c                   | j         +| j        j        t          j        u rt          j                    S | j         s| j                            | j                  S | j         j	        }| j        j        t          j
        t          j        fv rH|j        s@t          j
                    }|                    dd           |xj        |j         z  c_        n)t          j
                    }|xj        |j         z  c_        |S )z:class:`.Permissions`: Returns the resolved permissions for the invoking user in this channel.
        Shorthand for :meth:`.abc.GuildChannel.permissions_for` or :attr:`.Interaction.permissions`.

        .. versionadded:: 2.0
        NTmanage_channelsmanage_roles)rS   r   r   r   privater   _dm_permissionspermissions_forr   permissionsvoicestage_voiceconnectupdater   )rN   basedenieds      rC   r   zContext.permissions  s     #(9[=P(P(P.000 	=<//<<<+<!2K4K LLL< , %*,,dFFF

v|m+

 !&((FJJ6<-'JJrE   c                |   | j         }| j        (|j        t          j        k    rt          j                    S | j        s|                    | j                  S |j	        }| j        j
        }| j         j        t          j        t          j        fv rH|j        s@t          j                    }|                    dd           |xj        |j         z  c_        n)t          j                    }|xj        |j         z  c_        |                    ddd           t!          |t"                    rd|_        nd|_        |S )aW  :class:`.Permissions`: Returns the resolved permissions for the bot in this channel.
        Shorthand for :meth:`.abc.GuildChannel.permissions_for` or :attr:`.Interaction.app_permissions`.

        For interaction-based commands, this will reflect the effective permissions
        for :class:`Context` calls, which may differ from calls through
        other :class:`.abc.Messageable` endpoints, like :attr:`channel`.

        Notably, sending messages, embedding links, and attaching files are always
        permitted, while reading messages might not be.

        .. versionadded:: 2.0
        NTr   F)embed_linksattach_filessend_tts_messages)r   rS   r   r   r   r   r   r   r   r   app_permissionsr   r   r   r   r   r   r   send_messages_in_threadssend_messages)rN   r   r   r   r   s        rC   bot_permissionszContext.bot_permissions  s9    ,#8K(K(K.000 	4**47333/<!2K4K LLL< , %*,,dFFF

v|m+

 !&((FJJ6<-'JJ# 	 	
 	
 	

 gv&& 	&,0D))!%DrE   Optional[VoiceProtocol]c                &    | j         }|r|j        ndS )z]Optional[:class:`.VoiceProtocol`]: A shortcut to :attr:`.Guild.voice_client`\, if applicable.N)r   voice_client)rN   gs     rC   r   zContext.voice_client!  s     J!",q~~,rE   r   c                <  K   ddl m}m}m} ddlm} | j        }|j        }|dS |                                }| |_	        t          |          dk    r|                    | d           d{V  |                                } ||j                  }		  |	|           d{V S # |$ r'}
|                    | |
           d{V  Y d}
~
dS d}
~
ww xY w|d         }t          |t                     r*|                    |          p|                    |          }|dS 	 |j         n# t(          $ r Y dS w xY w|                    | |j                   d{V  	 t+          |          r! ||j                  }	 |	|           d{V S t          ||          r! ||j                  }	 |	|           d{V S t          ||          r! ||j                  }	 |	|           d{V S dS # |$ r'}
|                    | |
           d{V  Y d}
~
dS d}
~
ww xY w)aR  send_help(entity=<bot>)

        |coro|

        Shows the help command for the specified entity if given.
        The entity can be a command or a cog.

        If no entity is given, then it'll show help for the
        entire bot.

        If the entity is a string, then it looks up whether it's a
        :class:`Cog` or a :class:`Command`.

        .. note::

            Due to the way this function works, instead of returning
            something similar to :meth:`~.commands.HelpCommand.command_not_found`
            this returns ``None`` on bad input or no help command.

        Parameters
        ------------
        entity: Optional[Union[:class:`Command`, :class:`Cog`, :class:`str`]]
            The entity to show help for.

        Returns
        --------
        Any
            The result of the help command, if any.
        r   )r3   Groupwrap_callback)CommandErrorNr   )corer3   r   r   errorsr   rw   help_commandcopycontextr   prepare_help_commandget_bot_mappingsend_bot_helpon_help_command_errorr   r   get_cogget_commandqualified_nameAttributeErrorrD   send_cog_helpsend_group_helpsend_command_help)rN   rk   r3   r   r   r   rw   r   mappinginjectedeentitys               rC   	send_helpzContext.send_help'  s     < 	8777777777((((((h;4hhjjt99>>**4666666666))++G$}S%677H%Xg.........   //a888888888ttttt afc"" 	D[[((CCOOF,C,CF>4	!!! 	 	 	44	 &&tV-BCCCCCCCCC	5f~~ 
(=):;;%Xf---------FE** (=)<==%Xf---------FG,, (=)>??%Xf---------t 	5 	5 	5++D!444444444444444	5sN   B% %C*CC D( (
D65D6/G/ 0G/ <0G/ /H4HH.)	filedelete_afternonceallowed_mentions	referencemention_authorsuppress_embedsrJ   silentr  r'   r  floatr  Union[str, int]r  r(   r  0Union[Message, MessageReference, PartialMessage]r  r/   r  rJ   r  c       
        
   K   d S rM   re   rN   r  r  r  r  r  r  rx   r  rJ   r  s              rC   replyzContext.replyy         #rE   )	filesr  r  r  r  r  r  rJ   r  r$  Sequence[File]c       
        
   K   d S rM   re   rN   r$  r  r  r  r  r  rx   r  rJ   r  s              rC   r"  zContext.reply  r#  rE   )r   embedr  stickersr  r  r  r  r  rx   r  rJ   r  pollr   r   r(  r&   r)  *Sequence[Union[GuildSticker, StickerItem]]r.   r*  r1   c               
   K   d S rM   re   rN   r   r   r(  r  r)  r  r  r  r  r  rx   r  rJ   r  r*  s                   rC   r"  zContext.reply        & #rE   )r   r(  r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  c               
   K   d S rM   re   rN   r   r   r(  r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  s                   rC   r"  zContext.reply  r.  rE   )r   r   r  r)  r  r  r  r  r  rx   r  rJ   r  r*  r   Sequence[Embed]c               
   K   d S rM   re   rN   r   r   r   r  r)  r  r  r  r  r  rx   r  rJ   r  r*  s                   rC   r"  zContext.reply  r.  rE   )r   r   r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  c               
   K   d S rM   re   rN   r   r   r   r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  s                   rC   r"  zContext.reply  r.  rE   c                r   K   | j          | j        |fd| j        i| d{V S  | j        |fi | d{V S )a_  |coro|

        A shortcut method to :meth:`send` to reply to the
        :class:`~discord.Message` referenced by this context.

        For interaction based contexts, this is the same as :meth:`send`.

        .. versionadded:: 1.6

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Raises
        --------
        ~discord.HTTPException
            Sending the message failed.
        ~discord.Forbidden
            You do not have the proper permissions to send the message.
        ValueError
            The ``files`` list is not of the appropriate size
        TypeError
            You specified both ``file`` and ``files``.

        Returns
        ---------
        :class:`~discord.Message`
            The message that was sent.
        Nr  )rS   sendrv   )rN   r   rl   s      rC   r"  zContext.reply  sp      < #"7MMdlMfMMMMMMMMM"755f555555555rE   rR    Union[Typing, DeferTyping[BotT]]c               P    | j         t          |           S t          | |          S )a  Returns an asynchronous context manager that allows you to send a typing indicator to
        the destination for an indefinite period of time, or 10 seconds if the context manager
        is called using ``await``.

        In an interaction based context, this is equivalent to a :meth:`defer` call and
        does not do any typing calls.

        Example Usage: ::

            async with channel.typing():
                # simulate something heavy
                await asyncio.sleep(20)

            await channel.send('Done!')

        Example Usage: ::

            await channel.typing()
            # Do some computational magic for about 10 seconds
            await channel.send('Done!')

        .. versionchanged:: 2.0
            This no longer works with the ``with`` syntax, ``async with`` must be used instead.

        .. versionchanged:: 2.0
            Added functionality to ``await`` the context manager to send a typing indicator for 10 seconds.

        Parameters
        -----------
        ephemeral: :class:`bool`
            Indicates whether the deferred message will eventually be ephemeral.
            Only valid for interaction based contexts.

            .. versionadded:: 2.0
        NrR   )rS   r   rG   rN   rJ   s     rC   typingzContext.typing  s-    H #$<<495555rE   c               h   K   | j         r(| j         j                            |           d{V  dS dS )a_  |coro|

        Defers the interaction based contexts.

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

        If this isn't an interaction based context then it does nothing.

        Parameters
        -----------
        ephemeral: :class:`bool`
            Indicates whether the deferred message will eventually be ephemeral.

        Raises
        -------
        HTTPException
            Deferring the interaction failed.
        InteractionResponded
            This interaction has already been responded to before.
        rR   N)rS   rT   rV   r:  s     rC   rV   zContext.defer8  sU      .  	G"+11I1FFFFFFFFFFF	G 	GrE   c       
        
   K   d S rM   re   r!  s              rC   r7  zContext.sendR  r#  rE   c       
        
   K   d S rM   re   r'  s              rC   r7  zContext.sendb  r#  rE   c               
   K   d S rM   re   r-  s                   rC   r7  zContext.sendr  r.  rE   c               
   K   d S rM   re   r0  s                   rC   r7  zContext.send  r.  rE   c               
   K   d S rM   re   r3  s                   rC   r7  zContext.send  r.  rE   c               
   K   d S rM   re   r5  s                   rC   r7  zContext.send  r.  rE   )r   r(  r   r  r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  Optional[Embed]Optional[Sequence[Embed]]Optional[File]Optional[Sequence[File]]4Optional[Sequence[Union[GuildSticker, StickerItem]]]Optional[float]Optional[Union[str, int]]Optional[AllowedMentions]:Optional[Union[Message, MessageReference, PartialMessage]]Optional[bool]Optional[BaseView]Optional[Poll]c                 K   | j         | j                                         r7t                                          |||||||||	|
||||||           d{V S |||t          n||t          n||t          n||t          n||
t          n|
|t          n|||||t          n|d}| j         j                                        r" | j         j        j        di |ddi d{V }nc | j         j        j        di | d{V }t          |j
        t          j                  s | j                                          d{V }n|j
        }||                    |           d{V  |S )a  |coro|

        Sends a message to the destination with the content given.

        This works similarly to :meth:`~discord.abc.Messageable.send` for non-interaction contexts.

        For interaction based contexts this does one of the following:

        - :meth:`discord.InteractionResponse.send_message` if no response has been given.
        - A followup message if a response has been given.
        - Regular send if the interaction has expired

        .. versionchanged:: 2.0
            This function will now raise :exc:`TypeError` or
            :exc:`ValueError` instead of ``InvalidArgument``.

        Parameters
        ------------
        content: Optional[:class:`str`]
            The content of the message to send.
        tts: :class:`bool`
            Indicates if the message should be sent using text-to-speech.
        embed: :class:`~discord.Embed`
            The rich embed for the content.
        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.
        nonce: :class:`int`
            The nonce to use for sending this message. If the message was successfully sent,
            then the message will have a nonce with this value.
        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.
        allowed_mentions: :class:`~discord.AllowedMentions`
            Controls the mentions being processed in this message. If this is
            passed, then the object is merged with :attr:`~discord.Client.allowed_mentions`.
            The merging behaviour only overrides attributes that have been explicitly passed
            to the object, otherwise it uses the attributes set in :attr:`~discord.Client.allowed_mentions`.
            If no object is passed at all then the defaults given by :attr:`~discord.Client.allowed_mentions`
            are used instead.

            .. versionadded:: 1.4

        reference: Union[:class:`~discord.Message`, :class:`~discord.MessageReference`, :class:`~discord.PartialMessage`]
            A reference to the :class:`~discord.Message` to which you are replying, this can be created using
            :meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`. You can control
            whether this mentions the author of the referenced message using the :attr:`~discord.AllowedMentions.replied_user`
            attribute of ``allowed_mentions`` or by setting ``mention_author``.

            This is ignored for interaction based contexts.

            .. versionadded:: 1.6

        mention_author: Optional[:class:`bool`]
            If set, overrides the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions``.
            This is ignored for interaction based contexts.

            .. versionadded:: 1.6
        view: Union[:class:`discord.ui.View`, :class:`discord.ui.LayoutView`]
            A Discord UI View to add to the message.

            .. versionadded:: 2.0
        embeds: List[:class:`~discord.Embed`]
            A list of embeds to upload. Must be a maximum of 10.

            .. versionadded:: 2.0
        stickers: Sequence[Union[:class:`~discord.GuildSticker`, :class:`~discord.StickerItem`]]
            A list of stickers to upload. Must be a maximum of 3. This is ignored for interaction based contexts.

            .. versionadded:: 2.0
        suppress_embeds: :class:`bool`
            Whether to suppress embeds for the message. This sends the message without any embeds if set to ``True``.

            .. versionadded:: 2.0
        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. **This is only applicable in contexts with an interaction**.

            .. versionadded:: 2.0
        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

        poll: Optional[:class:`~discord.Poll`]
            The poll to send with this message.

            .. versionadded:: 2.4
            .. versionchanged:: 2.6
                This can now be ``None`` and defaults to ``None`` instead of ``MISSING``.

        Raises
        --------
        ~discord.HTTPException
            Sending the message failed.
        ~discord.Forbidden
            You do not have the proper permissions to send the message.
        ValueError
            The ``files`` list is not of the appropriate size.
        TypeError
            You specified both ``file`` and ``files``,
            or you specified both ``embed`` and ``embeds``,
            or the ``reference`` object is not a :class:`~discord.Message`,
            :class:`~discord.MessageReference` or :class:`~discord.PartialMessage`.

        Returns
        ---------
        :class:`~discord.Message`
            The message that was sent.
        N)r   r   r(  r   r  r$  r)  r  r  r  r  r  rx   r  r  r*  )r   r   r(  r   r  r$  r  rx   r  rJ   r  r*  waitT)delayre   )rS   
is_expiredsuperr7  r9   rT   rU   followupsend_messager   resourcer   InteractionMessageoriginal_responsedelete)rN   r   r   r(  r   r  r$  r)  r  r  r  r  r  rx   r  rJ   r  r*  rl   msgrT   	__class__s                        rC   r7  zContext.send  s     P #t'7'B'B'D'D#!)!1#- /! &         *  %WW5!'ggV#|GG %WW5+;+CIY#|GG."#|GG
 
 $,,.. 	(6(16KKKKdKKKKKKKKKCCCT-6CMMfMMMMMMMMHh/1KLL ( ,>>@@@@@@@@'#**<*000000000
rE   )rv   r   rw   r   rx   r   rk   ry   rl   rz   rm   r{   rn   r|   ro   r{   rp   r}   rq   r|   rr   r{   rs   rK   rt   r~   ru   r{   rS   r   )rS   r   r>   r   )rn   r   rk   r   rl   r   r>   r:   )r   rK   r   rK   r>   rP   )r>   rK   )r>   r   )r>   r   )r>   r   )r>   r   )r>   r   )r>   r    )r>   r   )r>   r   )r>   r   )r>   r   )rk   r   r>   r   )r  r'   r  r  r  r  r  r(   r  r  r  rK   rx   r/   r  rK   rJ   rK   r  rK   r>   r   )r$  r%  r  r  r  r  r  r(   r  r  r  rK   rx   r/   r  rK   rJ   rK   r  rK   r>   r   ).) r   r{   r   rK   r(  r&   r  r'   r)  r+  r  r  r  r  r  r(   r  r  r  rK   rx   r.   r  rK   rJ   rK   r  rK   r*  r1   r>   r   ) r   r{   r   rK   r(  r&   r$  r%  r)  r+  r  r  r  r  r  r(   r  r  r  rK   rx   r.   r  rK   rJ   rK   r  rK   r*  r1   r>   r   ) r   r{   r   rK   r   r1  r  r'   r)  r+  r  r  r  r  r  r(   r  r  r  rK   rx   r.   r  rK   rJ   rK   r  rK   r*  r1   r>   r   ) r   r{   r   rK   r   r1  r$  r%  r)  r+  r  r  r  r  r  r(   r  r  r  rK   rx   r.   r  rK   rJ   rK   r  rK   r*  r1   r>   r   rM   )r   r{   rl   r   r>   r   )rJ   rK   r>   r8  )rJ   rK   r>   rP   )$r   r{   r   rK   r(  rC  r   rD  r  rE  r$  rF  r)  rG  r  rH  r  rI  r  rJ  r  rK  r  rL  rx   rM  r  rK   rJ   rK   r  rK   r*  rN  r>   r   )!rg   rh   ri   __doc__r9   rO   classmethodr   r   r   propertyr   r   r   r   r   r   r   cached_propertyr   r   r   r   r   r   r   r  r   r"  r;  rV   r7  __classcell__)r[  s   @rC   r8   r8   n   s       E EZ "!( $48&*%,?C+/$15*.37#"; "; "; "; "; ";H W W W [Wr#4 #4 #4 #4J 49$ <7 <7 <7 <7 <7 <7| D D D XD    X X X XX        X  t t t Xt ]"" " " #"" ]"$ $ $ #"$ ]"# # # #"# ]"J J J #"J ]"   #"2 ]") ) ) #")V - - - X-
P5 P5 P5 P5d  !!$,/FI" #     X  !$!!$,/FI" #     X  "% ?B!!$,/FI" ##     X(  "%  #?B!!$,/FI" ##     X(  "% "%?B!!$,/FI" ##     X(  "% "% #?B!!$,/FI" ##     X(!6 !6 !6 !6 !6F +0 &6 &6 &6 &6 &6 &6P 05 G G G G G G4  !!$,/FI" #     X  !$!!$,/FI" #     X  "% ?B!!$,/FI" ##     X(  "%  #?B!!$,/FI" ##     X(  "% "%?B!!$,/FI" ##     X(  "% "% #?B!!$,/FI" ##     X, "&w !%,0#*.IM(,+/6:PT)-#' %#'w w w w w w w w w w w wrE   r8   )r=   r   r>   r?   )\r\  
__future__r   r   r;  r   r   r   r   r   r	   r
   r   r   r   r   r   discord.abcr   discord.utilsr   r   r   r   r   r   r   r   r   discord.context_managersr   rx   r   _typesr   typing_extensionsr   r   r   r    discord.guildr!   discord.memberr"   discord.stater#   discord.userr$   discord.voice_clientr%   discord.embedsr&   discord.filer'   discord.mentionsr(   discord.stickerr)   r*   discord.messager+   r,   discord.ui.viewr-   r.   r/   discord.types.interactionsr0   discord.pollr1   r   r2   r   r3   
parametersr4   typesr5   BaseExceptionr6   __all__r   r9   __annotations__r:   r;   r<   rD   rG   abcMessageabler8   re   rE   rC   <module>r{     s    0 # " " " " " 				 y y y y y y y y y y y y y y y y y y y y y y y y y y y y         } } } } } } } } } } } } } } } } } } } } } } + + + + + +             ,<<<<<<<<<<......######%%%%%%------''''''222222$$$$$$!!!!!!00000099999999@@@@@@@@::::::::::LLLLLL!!!!!!%%%%%%######	]	+	+	+B
 }$ $ $ $ $ GCLLwvU### 	#AAA, , , ,    '$-   0O O O O Ogk%wt} O O O O OrE   