o
    -˜Žj†  ã                   @   sB   d dl mZmZ d dlZd dlmZmZmZmZ G dd„ dƒZdS )é    )ÚListÚUnionN)ÚenumsÚrawÚtypesÚutilsc                '   @   sà   e Zd Zddddddddddddddejjjfdddedede	d de
e
eef e	e
eef  f d	e
e
eef e	e
eef  f d
e
e
eef e	e
eef  f dededededededededddedddef&dd„ZdS )ÚUpdateFolderNÚselfzpyrogram.ClientÚ	folder_idÚtitleÚtitle_entitiesztypes.MessageEntityÚincluded_chatsÚexcluded_chatsÚpinned_chatsÚcontactsÚnon_contactsÚgroupsÚchannelsÚbotsÚexclude_mutedÚexclude_readÚexclude_archivedÚcolorzenums.FolderColorÚemojiÚ
parse_modezpyrogram.enums.ParseModeÚreturnc                 ƒ   s
  �t  ˆ |||¡I dH  ¡ \}}t|tƒs|r|gng }t|tƒs(|r&|gng }t|tƒs4|r2|gng }ˆ  tjjj	|tj
j|tj
j||pFg d�‡ fdd„|D ƒI dH ‡ fdd„|D ƒI dH ‡ fdd„|D ƒI dH |||	|
||||||rw|jndd�d�¡I dH }t|ƒS )	a  Create or update a user's folder.

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

        Parameters:
            folder_id (``int``):
                Unique folder identifier.

            title (``str``):
                Folder title.

            title_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
                Entities for the folder title.

            included_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
                Users or chats that should added in the folder
                You can pass an ID (int), username (str) or phone number (str).
                Multiple users can be added by passing a list of IDs, usernames or phone numbers.

            excluded_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
                Users or chats that should excluded from the folder
                You can pass an ID (int), username (str) or phone number (str).
                Multiple users can be added by passing a list of IDs, usernames or phone numbers.

            pinned_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
                Users or chats that should pinned in the folder
                You can pass an ID (int), username (str) or phone number (str).
                Multiple users can be added by passing a list of IDs, usernames or phone numbers.

            contacts (``bool``, *optional*):
                Pass True if folder should contain contacts.

            non_contacts (``bool``, *optional*):
                Pass True if folder should contain non contacts.

            groups (``bool``, *optional*):
                Pass True if folder should contain groups.

            channels (``bool``, *optional*):
                Pass True if folder should contain channels.

            bots (``bool``, *optional*):
                Pass True if folder should contain bots.

            exclude_muted (``bool``, *optional*):
                Pass True if folder should exclude muted users.

            exclude_archived (``bool``, *optional*):
                Pass True if folder should exclude archived users.

            emoji (``str``, *optional*):
                Folder emoji.
                Pass None to leave the folder icon as default.

            color (:obj:`~pyrogram.enums.FolderColor`, *optional*):
                Color type.
                Pass :obj:`~pyrogram.enums.FolderColor` to set folder color.

            parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
                The parse mode to use for the title.

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

        Example:
            .. code-block:: python

                # Create or update folder
                app.update_folder(folder_id, title="New folder", included_chats="me")
        N)ÚtextÚentitiesc                 “   ó   �g | ]
}ˆ   |¡I d H ‘qS ©N©Úresolve_peer©Ú.0Úuser_id©r	   © úa/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/chats/update_folder.pyÚ
<listcomp>‡   ó
   € ÿÿz.UpdateFolder.update_folder.<locals>.<listcomp>c                 “   r   r   r    r"   r%   r&   r'   r(   ‹   r)   c                 “   r   r   r    r"   r%   r&   r'   r(   �   r)   )Úidr   Úpinned_peersÚinclude_peersÚexclude_peersr   r   r   Ú
broadcastsr   r   r   r   Úemoticonr   )r*   Úfilter)r   Úparse_text_entitiesÚvaluesÚ
isinstanceÚlistÚinvoker   Ú	functionsÚmessagesÚUpdateDialogFilterr   ÚDialogFilterÚTextWithEntitiesÚvalueÚbool)r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Ú
title_textÚrr&   r%   r'   Úupdate_folder   sP   €Z


þ

þ

þ

þåþ
ÿ#zUpdateFolder.update_folder)Ú__name__Ú
__module__Ú__qualname__Úpyrogramr   Ú	ParseModeÚDEFAULTÚintÚstrr   r   r<   r?   r&   r&   r&   r'   r      sn    îÿþýüûúùø	÷
öõôóòñðïîír   )	Útypingr   r   rC   r   r   r   r   r   r&   r&   r&   r'   Ú<module>   s   