@@ -26,14 +26,14 @@ class UpdateFolder:
2626 async def update_folder (
2727 self : "pyrogram.Client" ,
2828 folder_id : int ,
29- title : str ,
30- pinned_peers : Union [Union [int , str ], List [Union [int , str ]]],
31- included_peers : Union [Union [int , str ], List [Union [int , str ]]],
32- excluded_peers : Union [ Union [ int , str ], List [ Union [ int , str ]]] ,
29+ included_chats : Union [ Union [ int , str ], List [ Union [ int , str ]]] = None ,
30+ excluded_chats : Union [Union [int , str ], List [Union [int , str ]]] = None ,
31+ pinned_chats : Union [Union [int , str ], List [Union [int , str ]]] = None ,
32+ title : str = None ,
3333 contacts : bool = None ,
3434 non_contacts : bool = None ,
3535 groups : bool = None ,
36- broadcasts : bool = None ,
36+ channels : bool = None ,
3737 bots : bool = None ,
3838 exclude_muted : bool = None ,
3939 exclude_read : bool = None ,
@@ -44,21 +44,68 @@ async def update_folder(
4444
4545 .. include:: /_includes/usable-by/users.rst
4646
47+ Parameters:
48+ folder_id (``int``):
49+ Unique folder identifier.
50+
51+ included_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
52+ Users or chats that should added in the folder
53+ You can pass an ID (int), username (str) or phone number (str).
54+ Multiple users can be added by passing a list of IDs, usernames or phone numbers.
55+
56+ excluded_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
57+ Users or chats that should excluded from the folder
58+ You can pass an ID (int), username (str) or phone number (str).
59+ Multiple users can be added by passing a list of IDs, usernames or phone numbers.
60+
61+ pinned_chats (``int`` | ``str`` | List of ``int`` or ``str``, *optional*):
62+ Users or chats that should pinned in the folder
63+ You can pass an ID (int), username (str) or phone number (str).
64+ Multiple users can be added by passing a list of IDs, usernames or phone numbers.
65+
66+ title (``str``, *optional*):
67+ A folder title was changed to this value.
68+
69+ contacts (``bool``, *optional*):
70+ Pass True if folder should contain contacts.
71+
72+ non_contacts (``bool``, *optional*):
73+ Pass True if folder should contain non contacts.
74+
75+ groups (``bool``, *optional*):
76+ Pass True if folder should contain groups.
77+
78+ channels (``bool``, *optional*):
79+ Pass True if folder should contain channels.
80+
81+ bots (``bool``, *optional*):
82+ Pass True if folder should contain bots.
83+
84+ exclude_muted (``bool``, *optional*):
85+ Pass True if folder should exclude muted users.
86+
87+ exclude_archived (``bool``, *optional*):
88+ Pass True if folder should exclude archived users.
89+
90+ emoji (``str``, *optional*):
91+ Folder emoji.
92+ Pass None to leave the folder icon as default.
93+
4794 Returns:
4895 ``bool``: True, on success.
4996
5097 Example:
5198 .. code-block:: python
5299
53100 # Delete folder
54- app.delete_folder (folder_id)
101+ app.update_folder (folder_id, title="New folder", included_chats=["me"] )
55102 """
56- if not isinstance (pinned_peers , list ):
57- pinned_peers = [pinned_peers ]
58- if not isinstance (included_peers , list ):
59- included_peers = [included_peers ]
60- if not isinstance (excluded_peers , list ):
61- excluded_peers = [excluded_peers ]
103+ if not isinstance (included_chats , list ):
104+ included_chats = [included_chats ]
105+ if not isinstance (excluded_chats , list ):
106+ excluded_chats = [excluded_chats ]
107+ if not isinstance (pinned_chats , list ):
108+ pinned_chats = [pinned_chats ]
62109
63110 r = await self .invoke (
64111 raw .functions .messages .UpdateDialogFilter (
@@ -68,20 +115,20 @@ async def update_folder(
68115 title = title ,
69116 pinned_peers = [
70117 await self .resolve_peer (user_id )
71- for user_id in pinned_peers
118+ for user_id in pinned_chats
72119 ],
73120 include_peers = [
74121 await self .resolve_peer (user_id )
75- for user_id in included_peers
122+ for user_id in included_chats
76123 ],
77124 exclude_peers = [
78125 await self .resolve_peer (user_id )
79- for user_id in excluded_peers
126+ for user_id in excluded_chats
80127 ],
81128 contacts = contacts ,
82129 non_contacts = non_contacts ,
83130 groups = groups ,
84- broadcasts = broadcasts ,
131+ broadcasts = channels ,
85132 bots = bots ,
86133 exclude_muted = exclude_muted ,
87134 exclude_read = exclude_read ,
0 commit comments