
    i
                     8    S SK r S SKrS SKJrJr   " S S5      rg)    N)rawutilsc            	       4    \ rS rSr S
SSS\S\S\4S jjrSrg	)LeaveFolder   selfzpyrogram.Clientlink
keep_chatsreturnc                   #    [         R                  " SU5      nU(       a  UR                  S5      nO#[        U[        5      (       a  UnO[        S5      eU R                  [        R                  R                  R                  US95      I Sh  vN nU R                  [        R                  R                  R                  [        R                  R                  UR                  S9U(       dH  UR                   Vs/ s H0  nU R!                  ["        R$                  " U5      5      I Sh  vN PM2     snO/ S95      I Sh  vN   g N Ns  snf  N7f)	a  Leave a folder by its invite link.

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

Parameters:
    link (``str``):
        Invite link of the folder.

    keep_chats (``bool``, *optional*):
        If True, the chats from the folder will be kept in the user's account.
        Defaults to True.

Returns:
    ``bool``: True, on success.

Raises:
    AttributeError: In case the folder invite link does not exist in the user's account.
    BadRequest: In case the folder invite link not exists.
    ValueError: In case the folder invite link is invalid.

Example:
    .. code-block:: python

        # leave folder
        await app.leave_folder("t.me/addlist/ebXQ0Q0I3RnGQ")
zS^(?:https?://)?(?:www\.)?(?:t(?:elegram)?\.(?:org|me|dog)/(?:addlist/|\+))([\w-]+)$   zInvalid folder invite link)slugN)	filter_id)chatlistpeersT)rematchgroup
isinstancestr
ValueErrorinvoker   	functions	chatlistsCheckChatlistInviteLeaveChatlisttypesInputChatlistDialogFilterr   already_peersresolve_peerr   get_peer_id)r   r	   r
   r   r   rids          P/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/chats/leave_folder.pyleave_folderLeaveFolder.leave_folder   s.    > oquv;;q>Dc""D9::++MM##77 8 
 
 kkMM##11<<kk =  $  oo- ++E,=,=b,ABBB- *, 2 

 
	
 
	
 %
 C
	
sC   BEEA-E=.E+E
,E4EEE
EE N)T)__name__
__module____qualname____firstlineno__r   boolr%   __static_attributes__r'       r$   r   r      s5      ::: : 
	: :r.   r   )r   pyrogramr   r   r   r'   r.   r$   <module>r0      s   $ 
  ; ;r.   