
    N[i=                     p    d dl Z d dlZd dlmZ d dlmZ d dlmZ  e j                  e      Z	 G d d      Z
y)    N)raw)TLObject)Sessionc                   X    e Zd Zej                  ej
                  dfdddedededef
dZ	y)	InvokeNselfzpyrogram.Clientqueryretriestimeoutsleep_thresholdc                   K   | j                   st        d      | j                  r t        j                  j                  |      }| j                  r+t        j                  j                  | j                  |      }| j                  j                  |||||n| j                         d{   }| j                  t        |dg              d{    | j                  t        |dg              d{    |S 7 N7 ,7 
w)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   rs         S/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/advanced/invoke.pyr   zInvoke.invoke   s     P   !"CDD??MM66U6CE??MM33tV[3\E,,%%7G+ &&	
 
 wq'26777wq'26777
 	87s6   B*D,C;-#DC=#D4C?5D=D?D)
__name__
__module____qualname__r   MAX_RETRIESWAIT_TIMEOUTr   intfloatr        r   r   r      sL     ** --!%;;; ; 	;
 ;r%   r   )loggingpyrogramr   pyrogram.raw.corer   pyrogram.sessionr   	getLoggerr   logr   r$   r%   r   <module>r,      s2   &    & $g!< <r%   