
    N[i
                     D    d dl mZ d dlZd dlmZ d dlmZ  G d d      Zy)    )UnionN)raw)typesc                   *    e Zd Zdddeeef   ddfdZy)JoinChatselfzpyrogram.Clientchat_idreturnz
types.Chatc                   K   | j                   j                  t        |            }|r| j                  t        j
                  j                  j                  |j                  d                   d{   }t        |j                  d   t        j                  j                        r-t        j                  j                  | |j                  d         S t        |j                  d   t        j                  j                        r-t        j                  j                  | |j                  d         S y| j                  t        j
                  j                   j#                  | j%                  |       d{                d{   }t        j                  j                  | |j                  d         S 7 G7 E7 6w)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   )channel)INVITE_LINK_REmatchstrinvoker   	functionsmessagesImportChatInvitegroup
isinstancechatsr   Chat_parse_chat_chatChannel_parse_channel_chatchannelsJoinChannelresolve_peer)r   r	   r   chats       S/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/chats/join_chat.py	join_chatzJoinChat.join_chat   sP    8 ##))#g,7&&77Q 8  D
 $**Q-8zz224AGGDJJqM399+<+<=zz55dDJJqMJJ > &&22"&"3"3G"<< 3  D ::11$

1FF! =s7   A3G5F<6DG9F?:G
G2G?GGN)__name__
__module____qualname__r   intr   r"        r!   r   r      s-    /G/GsCx/G 
/Gr(   r   )typingr   pyrogramr   r   r   r'   r(   r!   <module>r+      s   &    0G 0Gr(   