U
    ;g                     @   sJ   d dl mZ d dlZd dlmZ d dlmZ d dlmZ G dd dZdS )    )UnionN)raw)types)utilsc                   @   s*   e Zd Zdeeef ed dddZdS )GetChatzpyrogram.Client)z
types.Chatztypes.ChatPreview)selfchat_idreturnc                    sB  | j t|}|r| tjjj|ddI dH }t	|tj
jrRt
j| |S | |jgI dH  t	|jtj
jr|jj }t	|jtj
jrt|jj}| |I dH }t	|tj
jr| tjjj|dI dH }nTt	|tj
jtj
jfr| tjjj|dI dH }n| tjjj|jdI dH }t
j| |I dH S )a$  Get up to date information about a chat.

        Information include current name of the user for one-on-one conversations, current username of a user, group or
        channel, etc.

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target chat.
                Unique identifier for the target chat in form of a *t.me/joinchat/* link, identifier (int) or username
                of the target channel/supergroup (in the format @username).

        Returns:
            :obj:`~pyrogram.types.Chat` | :obj:`~pyrogram.types.ChatPreview`: On success, if you've already joined the chat, a chat object is returned,
            otherwise, a chat preview object is returned.

        Raises:
            ValueError: In case the chat invite link points to a chat you haven't joined yet.

        Example:
            .. code-block:: python

                chat = await app.get_chat("pyrogram")
                print(chat)
           )hashN)Zchannel)id)r   ) ZINVITE_LINK_REmatchstrZinvoker   Z	functionsmessagesZCheckChatInvitegroup
isinstancer   Z
ChatInviteZChatPreview_parseZfetch_peersZchatZChatr   ZChannelr   Zget_channel_idZresolve_peerZInputPeerChannelZchannelsZGetFullChannelZInputPeerUserZInputPeerSelfZusersZGetFullUserZGetFullChatr   Z_parse_full)r   r   r   rZpeer r   _/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/chats/get_chat.pyget_chat   s*    

zGetChat.get_chatN)__name__
__module____qualname__r   intr   r   r   r   r   r   r      s   
r   )typingr   Zpyrogramr   r   r   r   r   r   r   r   <module>   s
   