From f832df14b4231ae1f971243e1e69433a1d5a6e36 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 8 Nov 2020 13:52:15 +0100 Subject: [PATCH] Add parameter is_anonymous to the method promote_chat_member --- pyrogram/methods/chats/promote_chat_member.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyrogram/methods/chats/promote_chat_member.py b/pyrogram/methods/chats/promote_chat_member.py index eb49bce0..15e08375 100644 --- a/pyrogram/methods/chats/promote_chat_member.py +++ b/pyrogram/methods/chats/promote_chat_member.py @@ -27,6 +27,7 @@ class PromoteChatMember(Scaffold): self, chat_id: Union[int, str], user_id: Union[int, str], + is_anonymous: bool = False, can_change_info: bool = True, can_post_messages: bool = False, can_edit_messages: bool = False, @@ -49,6 +50,9 @@ class PromoteChatMember(Scaffold): Unique identifier (int) or username (str) of the target user. For a contact that exists in your Telegram address book you can use his phone number (str). + is_anonymous (``bool``, *optional*): + Pass True, if the administrator's presence in the chat is hidden. + can_change_info (``bool``, *optional*): Pass True, if the administrator can change chat title, photo and other settings. @@ -89,6 +93,7 @@ class PromoteChatMember(Scaffold): channel=await self.resolve_peer(chat_id), user_id=await self.resolve_peer(user_id), admin_rights=raw.types.ChatAdminRights( + anonymous=is_anonymous or None, change_info=can_change_info or None, post_messages=can_post_messages or None, edit_messages=can_edit_messages or None,