File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525class SetChatTitle :
2626 async def set_chat_title (
27- self : "pyrogram.Client" ,
28- chat_id : Union [int , str ],
29- title : str
27+ self : "pyrogram.Client" , chat_id : Union [int , str ], title : str
3028 ) -> "types.Message" :
3129 """Change the title of a chat.
32-
30+
3331 Titles can't be changed for private chats.
3432 You must be an administrator in the chat for this to work and must have the appropriate admin rights.
3533
36- .. note::
37-
38- In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
39- setting is off.
40-
4134 .. include:: /_includes/usable-by/users-bots.rst
4235
4336 Parameters:
@@ -62,17 +55,11 @@ async def set_chat_title(
6255
6356 if isinstance (peer , raw .types .InputPeerChat ):
6457 r = await self .invoke (
65- raw .functions .messages .EditChatTitle (
66- chat_id = peer .chat_id ,
67- title = title
68- )
58+ raw .functions .messages .EditChatTitle (chat_id = peer .chat_id , title = title )
6959 )
7060 elif isinstance (peer , raw .types .InputPeerChannel ):
7161 r = await self .invoke (
72- raw .functions .channels .EditTitle (
73- channel = peer ,
74- title = title
75- )
62+ raw .functions .channels .EditTitle (channel = peer , title = title )
7663 )
7764 else :
7865 raise ValueError (f'The chat_id "{ chat_id } " belongs to a user' )
You can’t perform that action at this time.
0 commit comments