o
    -˜Žj™  ã                   @   s>   d dl mZmZmZ d dlZd dlmZmZ G dd„ dƒZdS )é    )ÚUnionÚOptionalÚAsyncGeneratorN)ÚtypesÚrawc                   @   s>   e Zd Z	ddddeeef dededeed  f
d	d
„ZdS )ÚGetDiscussionRepliesr   Úselfzpyrogram.ClientÚchat_idÚ
message_idÚlimitÚreturn)ztypes.MessageNc                 C  sÀ   �d}|pd}t d|ƒ}	 |  tjjj|  |¡I dH |dd||dddd�	¡I dH }dd„ |jD ƒ}d	d„ |jD ƒ}|j}	|	s@dS |	D ]}
t	j
j| |
||dd
�I dH V  |d7 }||kr^ dS qBq)aõ  Get the message replies of a discussion thread.

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.
                You can also use chat public link in form of *t.me/<username>* (str).

            message_id (``int``):
                Message id.

            limit (``int``, *optional*):
                Limits the number of messages to be retrieved.
                By default, no limit is applied and all messages are returned.

        Example:
            .. code-block:: python

                async for message in app.get_discussion_replies(chat_id, message_id):
                    print(message)
        r   iÿÿÿéd   TN)	ÚpeerÚmsg_idÚ	offset_idÚoffset_dateÚ
add_offsetr   Úmax_idÚmin_idÚhashc                 S   ó   i | ]}|j |“qS © ©Úid)Ú.0Úur   r   úm/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/messages/get_discussion_replies.pyÚ
<dictcomp>K   ó    z?GetDiscussionReplies.get_discussion_replies.<locals>.<dictcomp>c                 S   r   r   r   )r   Úcr   r   r   r   L   r   )Úrepliesé   )ÚminÚinvoker   Ú	functionsÚmessagesÚ
GetRepliesÚresolve_peerÚusersÚchatsr   ÚMessageÚ_parse)r   r	   r
   r   ÚcurrentÚtotalÚrr(   r)   r%   Úmessager   r   r   Úget_discussion_replies   s<   €
÷
ÿÿåz+GetDiscussionReplies.get_discussion_repliesN)r   )	Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrr   r   r0   r   r   r   r   r      s    üÿ
þýü
ûr   )Útypingr   r   r   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s   