U
    ;g
                     @   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 ddddZdS )JoinChatzpyrogram.Clientz
types.Chat)selfchat_idreturnc                    s   | j t|}|r| tjjj|ddI dH }t	|j
d tjjr^tj| |j
d S t	|j
d tjjrtj| |j
d S n<| tjjj| |I dH dI dH }tj| |j
d S dS )aW  Join a group chat or channel.

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

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

        Returns:
            :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.

        Example:
            .. code-block:: python

                # Join chat via invite link
                await app.join_chat("https://t.me/+AbCdEf0123456789")

                # Join chat via username
                await app.join_chat("pyrogram")

                # Join a linked chat
                await app.join_chat(app.get_chat("pyrogram").linked_chat.id)
           )hashNr   )Zchannel)ZINVITE_LINK_REmatchstrZinvoker   Z	functionsmessagesZImportChatInvitegroup
isinstanceZchatsr   ZChatZ_parse_chat_chatZChannelZ_parse_channel_chatZchannelsZJoinChannelZresolve_peer)r   r   r   Zchat r   `/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/chats/join_chat.py	join_chat   s"    

zJoinChat.join_chatN)__name__
__module____qualname__r   intr   r   r   r   r   r   r      s   
r   )typingr   Zpyrogramr   r   r   r   r   r   r   <module>   s   