U
    ;g=                     @   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                   @   s.   e Zd ZejejdfdeeeedddZ	dS )InvokeNzpyrogram.Client)self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k	rR|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   NZusersZchats)Zis_connectedConnectionErrorZ
no_updatesr   Z	functionsZInvokeWithoutUpdatesr   ZInvokeWithTakeoutsessioninvoker
   Zfetch_peersgetattr)r   r   r   r	   r
   r r   `/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/advanced/invoke.pyr      s"    (  
zInvoke.invoke)
__name__
__module____qualname__r   ZMAX_RETRIESZWAIT_TIMEOUTr   intfloatr   r   r   r   r   r      s   r   )loggingZpyrogramr   Zpyrogram.raw.corer   Zpyrogram.sessionr   	getLoggerr   logr   r   r   r   r   <module>   s   
