
    N[i                     P    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      Zy)    )UnionN)raw)types)utilsc                   0    e Zd Zdddeeef   ded   fdZy)GetChatselfzpyrogram.Clientchat_idreturn)z
types.Chatztypes.ChatPreviewc                   K   | j                   j                  t        |            }|rT| j                  t        j
                  j                  j                  |j                  d                   d{   }t        |t        j                  j                        r t        j                  j                  | |      S | j                  |j                  g       d{    t        |j                  t        j                  j                         r|j                  j"                   }t        |j                  t        j                  j$                        r)t'        j(                  |j                  j"                        }| j+                  |       d{   }t        |t        j                  j,                        rB| j                  t        j
                  j.                  j1                  |             d{   }nt        |t        j                  j2                  t        j                  j4                  f      rB| j                  t        j
                  j6                  j9                  |             d{   }nK| j                  t        j
                  j                  j;                  |j<                               d{   }t        j                   j?                  | |       d{   S 7 {7 7 d7 7 7 :7 w)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)channel)id)r
   ) INVITE_LINK_REmatchstrinvoker   	functionsmessagesCheckChatInvitegroup
isinstancer   
ChatInviteChatPreview_parsefetch_peerschatChatr   Channelr   get_channel_idresolve_peerInputPeerChannelchannelsGetFullChannelInputPeerUserInputPeerSelfusersGetFullUserGetFullChatr
   _parse_full)r	   r
   r   rpeers        R/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/chats/get_chat.pyget_chatzGetChat.get_chat   s    < ##))#g,7kk&&66Q 7  A !SYY112((//a88""AFF8,,,!&&#))..16699*!&&#))"3"34..qvvyy9&&w//dCII667kk#--"8"8"G"GPT"G"UVVAsyy66		8O8OPQkk#--"5"5"A"AT"A"JKKAkk#--"8"8"D"DT\\"D"Z[[AZZ++D!4445 - 0 WK[4s   A3L5K06A'LK3B4LK6A$L7K98A?L7K<8ALK>'L+L ,L3L6L9L<L>L LN)__name__
__module____qualname__r   intr   r/        r.   r   r      s/    ;5;5sCx;5 
0	1;5r5   r   )typingr   pyrogramr   r   r   r   r4   r5   r.   <module>r8      s    &     <5 <5r5   