o
    -˜Žjˆ  ã                   @   sP   d dl Z d dlZd dlmZ d dlmZ d dlmZ e  e¡Z	G dd„ dƒZ
dS )é    N)Úraw)ÚTLObject)ÚSessionc                   @   s6   e Zd Zejejdfdddedededef
dd	„Z	dS )
ÚInvokeNÚselfzpyrogram.ClientÚqueryÚretriesÚtimeoutÚsleep_thresholdc                 Ã   s–   �| j stdƒ‚| jrtjj|d�}| jrtjj| j|d�}| j 	||||dur*|n| j
¡I dH }|  t|dg ƒ¡I dH  |  t|dg ƒ¡I dH  |S )aÞ  Invoke raw Telegram functions.

        This method makes it possible to manually call every single Telegram API method in a low-level manner.
        Available functions are listed in the :obj:`functions <pyrogram.api.functions>` package and may accept compound
        data types from :obj:`types <pyrogram.api.types>` as well as bare types such as ``int``, ``str``, etc...

        .. note::

            This is a utility method intended to be used **only** when working with raw
            :obj:`functions <pyrogram.api.functions>` (i.e: a Telegram API method you wish to use which is not
            available yet in the Client class as an easy-to-use method).

        .. include:: /_includes/usable-by/users-bots.rst

        Parameters:
            query (``RawFunction``):
                The API Schema function filled with proper arguments.

            retries (``int``):
                Number of retries.

            timeout (``float``):
                Timeout in seconds.

            sleep_threshold (``float``):
                Sleep threshold in seconds.

        Returns:
            ``RawType``: The raw type response generated by the query.

        Raises:
            RPCError: In case of a Telegram RPC error.
        zClient has not been started yet)r   )Ú
takeout_idr   NÚusersÚchats)Úis_connectedÚConnectionErrorÚ
no_updatesr   Ú	functionsÚInvokeWithoutUpdatesr   ÚInvokeWithTakeoutÚsessionÚinvoker
   Úfetch_peersÚgetattr)r   r   r   r	   r
   Úr© r   ú]/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/advanced/invoke.pyr      s    €(ÿ
üzInvoke.invoke)
Ú__name__Ú
__module__Ú__qualname__r   ÚMAX_RETRIESÚWAIT_TIMEOUTr   ÚintÚfloatr   r   r   r   r   r      s    ûÿþýüûr   )ÚloggingÚpyrogramr   Úpyrogram.raw.corer   Úpyrogram.sessionr   Ú	getLoggerr   Úlogr   r   r   r   r   Ú<module>   s   
