U
    ;gl                     @   s*   d dl Z d dl mZmZ G dd dZdS )    N)rawenumsc                   @   s*   e Zd ZdejjfdededddZdS )SearchGlobalCount zpyrogram.Clientzenums.MessagesFilter)selfqueryfilterreturnc                    sR   |  tjjj|| dddtj dddI dH }t|drD|j	S t
|jS dS )aV  Get the count of messages resulting from a global search.

        If you want to get the actual messages, see :meth:`~pyrogram.Client.search_global`.

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

        Parameters:
            query (``str``, *optional*):
                Text query string.
                Use "@" to search for mentions.

            filter (:obj:`~pyrogram.enums.MessagesFilter`, *optional*):
                Pass a filter in order to search for specific kind of messages only:

        Returns:
            ``int``: On success, the messages count is returned.
        r      )qr   Zmin_dateZmax_dateZoffset_rateZoffset_peerZ	offset_idlimitNcount)Zinvoker   Z	functionsmessagesZSearchGlobalvaluetypesZInputPeerEmptyhasattrr   len)r   r   r   r r   m/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/messages/search_global_count.pysearch_global_count   s    

z%SearchGlobalCount.search_global_countN)	__name__
__module____qualname__r   ZMessagesFilterZEMPTYstrintr   r   r   r   r   r      s   r   )Zpyrogramr   r   r   r   r   r   r   <module>   s   