U
    hQ                     @   sJ   d dl mZ d dlmZ ddlmZmZ ddlmZ G dd deeZ	dS )	   )
ChatGetter)SenderGetter   )utilshelpers)typesc                   @   s   e Zd ZdZdd ZdS )Forwarda  
    Custom class that encapsulates a :tl:`MessageFwdHeader` providing an
    abstraction to easily access information like the original sender.

    Remember that this class implements `ChatGetter
    <telethon.tl.custom.chatgetter.ChatGetter>` and `SenderGetter
    <telethon.tl.custom.sendergetter.SenderGetter>` which means you
    have access to all their sender and chat properties and methods.

    Attributes:

        original_fwd (:tl:`MessageFwdHeader`):
            The original :tl:`MessageFwdHeader` instance.

        Any other attribute:
            Attributes not described here are the same as those available
            in the original :tl:`MessageFwdHeader`.
    c                 C   s   | j |j  || _d  } } } } }}	|jrt|j}
|
tjjkrlt	|j}t
|||j\}}n4|
tjjtjjfkr|j}t
t	|||j\}}	tj| |||	d tj| |||d || _d S )N)chat
input_chat)senderinput_sender)__dict__updateZoriginal_fwdZfrom_idr   Z_entity_typeZ_EntityTypeUSERr   Zget_peer_idZ_get_entity_pairZ_mb_entity_cacheZCHATZCHANNELr   __init__r   Z_client)selfclientoriginalentitiesZ	sender_idr   r   Zpeerr	   r
   ty r   >/tmp/pip-unpacked-wheel-c81u5j2r/telethon/tl/custom/forward.pyr      s,      
  zForward.__init__N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   r   N)
Z
chatgetterr   Zsendergetterr    r   r   tlr   r   r   r   r   r   <module>   s   