
    N[i-
                     8    d dl mZ d dlZd dlmZ  G d d      Zy)    )UnionN)rawc                   .    e Zd Z	 ddddeeef   defdZy)	LeaveChatselfzpyrogram.Clientchat_iddeletec                   K   | j                  |       d{   }t        |t        j                  j                        rX| j                  t        j                  j                  j                  | j                  |       d{                d{   S t        |t        j                  j                        r| j                  t        j                  j                  j                  |j                  t        j                  j                                      d{   }|rB| j                  t        j                  j                  j                  |d             d{    |S y7 T7 7 7 R7 w)a  Leave a group chat or channel.

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

        Parameters:
            chat_id (``int`` | ``str``):
                Unique identifier for the target chat or username of the target channel/supergroup
                (in the format @username).

            delete (``bool``, *optional*):
                Deletes the group chat dialog after leaving (for simple group chats, not supergroups).
                Defaults to False.

        Example:
            .. code-block:: python

                # Leave chat or channel
                await app.leave_chat(chat_id)

                # Leave basic chat and also delete the dialog
                await app.leave_chat(chat_id, delete=True)
        N)channel)r   user_idr   )peermax_id)resolve_peer
isinstancer   typesInputPeerChannelinvoke	functionschannelsLeaveChannelInputPeerChatmessagesDeleteChatUserr   InputUserSelfDeleteHistory)r   r   r	   r   rs        T/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/chats/leave_chat.py
leave_chatzLeaveChat.leave_chat   s7    6 &&w//dCII667&&33"&"3"3G"<< 4   
 cii556kk&&55 LLII335 6  A kkMM**88!  9    H! 7 0
 =sZ   E6E+A*E6E.E6E0BE6E2 AE6#E4$E6.E60E62E64E6N)F)__name__
__module____qualname__r   intstrboolr        r   r   r      s.     33sCx3 3r&   r   )typingr   pyrogramr   r   r%   r&   r   <module>r)      s   &   4 4r&   