o
    -˜ŽjV	  ã                   @   s>   d dl mZ d dlZd dlmZ d dlmZ G dd„ dƒZdS )é    )ÚUnionN)Úraw)Útypesc                   @   s.   e Zd Zdddeeef deddfdd„Zd	S )
ÚGetDiscussionMessageÚselfzpyrogram.ClientÚchat_idÚ
message_idÚreturnztypes.Messagec                 Ã   sj   �|   tjjj|  |¡I dH |d�¡I dH }dd„ |jD ƒ}dd„ |jD ƒ}tj	 
| |jd ||¡I dH S )aC  Get the first discussion message of a channel post or a discussion thread in a group.

        Reply to the returned message to leave a comment on the linked channel post or to continue
        the 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.

        Example:
            .. code-block:: python

                # Get the discussion message
                m = await app.get_discussion_message(channel_id, message_id)

                # Comment to the post by replying
                await m.reply("comment")
        N)ÚpeerÚmsg_idc                 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_message.pyÚ
<dictcomp>@   ó    z?GetDiscussionMessage.get_discussion_message.<locals>.<dictcomp>c                 S   r   r   r   )r   Úcr   r   r   r   A   r   r   )Úinvoker   Ú	functionsÚmessagesr   Úresolve_peerÚusersÚchatsr   ÚMessageÚ_parse)r   r   r   Úrr   r   r   r   r   Úget_discussion_message   s   €þ
ÿz+GetDiscussionMessage.get_discussion_messageN)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrr   r   r   r   r   r      s    ÿ
þýür   )Útypingr   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s
   