
    N[i                     <    d dl mZ d dlZd dlmZmZ  G d d      Zy)    )UnionN)rawenumsc                   p    e Zd Zdej                  j
                  dfdddeeef   deddd	eeef   d
efdZ	y)SearchMessagesCount Nselfzpyrogram.Clientchat_idqueryfilterzenums.MessagesFilter	from_userreturnc                   K   | j                  t        j                  j                  j	                  | j                  |       d{   ||j                         ddddddd|r| j                  |       d{   ndd             d{   }t        |d      r|j                  S t        |j                        S 7 v7 G7 5w)a  Get the count of messages resulting from a search inside a chat.

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

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.
                For your personal cloud (Saved Messages) you can simply use "me" or "self".
                For a contact that exists in your Telegram address book you can use his phone number (str).

            query (``str``, *optional*):
                Text query string.
                Required for text-only messages, optional for media messages (see the ``filter`` argument).
                When passed while searching for media messages, the query will be applied to captions.
                Defaults to "" (empty string).

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

            from_user (``int`` | ``str``, *optional*):
                Unique identifier (int) or username (str) of the target user you want to search for messages from.

        Returns:
            ``int``: On success, the messages count is returned.
        Nr      )peerqr   min_datemax_date	offset_id
add_offsetlimitmin_idmax_idfrom_idhashcount)
invoker   	functionsmessagesSearchresolve_peervaluehasattrr   len)r	   r
   r   r   r   rs         b/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/messages/search_messages_count.pysearch_messages_countz)SearchMessagesCount.search_messages_count   s     D ++MM"")),,W55||~ ! ++I666! * 
 
* 1g77Nqzz?"- 6 7
s6   ACB<0C6B> 7C
C 2C>C C)
__name__
__module____qualname__r   MessagesFilterEMPTYr   intstrr'        r&   r   r      sf     ).)=)=)C)C%):#:#sCx:# :# '	:#
 c?:# 
:#r0   r   )typingr   pyrogramr   r   r   r/   r0   r&   <module>r3      s   &   ;# ;#r0   