B
    fdX                 @   sB   d dl mZmZ d dlZd dlmZ d dlmZ G dd dZdS )    )ListUnionN)raw)typesc               @   s*   e Zd Zdeeef ed dddZdS )GetSendAsChatszpyrogram.Clientz
types.Chat)selfchat_idreturnc                s   |  tjjj| |I dH dI dH }dd |jD }dd |jD }t	 }xR|j
D ]H}t|tjjr|tj| ||j  qX|tj| ||j  qXW |S )a  Get the list of "send_as" chats available.

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.

        Returns:
            List[:obj:`~pyrogram.types.Chat`]: The list of chats.

        Example:
            .. code-block:: python

                chats = await app.get_send_as_chats(chat_id)
                print(chats)
        N)Zpeerc             S   s   i | ]}||j qS  )id).0ur
   r
   L/tmp/pip-unpacked-wheel-rcokkf2l/pyrogram/methods/chats/get_send_as_chats.py
<dictcomp>6   s    z4GetSendAsChats.get_send_as_chats.<locals>.<dictcomp>c             S   s   i | ]}||j qS r
   )r   )r   cr
   r
   r   r   7   s    )Zinvoker   Z	functionsZchannelsZ	GetSendAsZresolve_peeruserschatsr   r   Zpeers
isinstanceZPeerUserappendZChatZ_parse_chatZuser_idZ
channel_id)r   r   rr   r   Zsend_as_chatspr
   r
   r   get_send_as_chats   s    z GetSendAsChats.get_send_as_chatsN)__name__
__module____qualname__r   intstrr   r   r
   r
   r
   r   r      s   
r   )typingr   r   Zpyrogramr   r   r   r
   r
   r
   r   <module>   s   