B
    fd                 @   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eeef eddddZdS )GetDiscussionMessagezpyrogram.Clientztypes.Message)selfchat_id
message_idreturnc                sh   |  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 )a  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.

            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)ZpeerZmsg_idc             S   s   i | ]}||j qS  )id).0ur
   r
   T/tmp/pip-unpacked-wheel-rcokkf2l/pyrogram/methods/messages/get_discussion_message.py
<dictcomp>>   s    z?GetDiscussionMessage.get_discussion_message.<locals>.<dictcomp>c             S   s   i | ]}||j qS r
   )r   )r   cr
   r
   r   r   ?   s    r   )Zinvoker   Z	functionsmessagesr   Z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   Zpyrogramr   r   r   r
   r
   r
   r   <module>   s   