o
    -˜Žj%  ã                   @   s2   d dl mZ d dlZd dlmZ G dd„ dƒZdS )é    )ÚUnionN)Úrawc                   @   s.   e Zd Z	d	dddeeef defdd„ZdS )
Ú	LeaveChatFÚselfzpyrogram.ClientÚchat_idÚdeletec                 Ã   s¾   �|   |¡I dH }| js| j |¡I dH  t|tjjƒr0|  tj	j
j|   |¡I dH d�¡I dH S t|tjjƒr]|  tj	jj|jtj ¡ d�¡I dH }|r[|  tj	jj|dd�¡I dH  |S dS )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).
                You can also use chat public link in form of *t.me/<username>* (str).

            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Úskip_updatesÚstorageÚremove_stateÚ
isinstancer   ÚtypesÚInputPeerChannelÚinvokeÚ	functionsÚchannelsÚLeaveChannelÚInputPeerChatÚmessagesÚDeleteChatUserr   ÚInputUserSelfÚDeleteHistory)r   r   r   r
   Úr© r   ú^/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/chats/leave_chat.pyÚ
leave_chat   s4   €ÿ
ÿþ
ÿþ
ÿðzLeaveChat.leave_chatN)F)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrÚboolr   r   r   r   r   r      s    ýÿ
þýr   )Útypingr   Úpyrogramr   r   r   r   r   r   Ú<module>   s   