From a86656aefcc93cc3d2f5c98227d5da28fcddb136 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 22 Mar 2021 16:26:39 +0100 Subject: [PATCH] Update Pyrogram to 1.2.4 Add missing parameters to chat.promote_member --- pyrogram/__init__.py | 2 +- pyrogram/types/user_and_chats/chat.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index bffdf2b5..de604ba3 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -__version__ = "1.2.3" +__version__ = "1.2.4" __license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)" __copyright__ = "Copyright (C) 2017-2021 Dan " diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py index 200a31eb..8930bf3a 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -609,6 +609,7 @@ class Chat(Object): async def promote_member( self, user_id: Union[int, str], + can_manage_chat: bool = True, can_change_info: bool = True, can_post_messages: bool = False, can_edit_messages: bool = False, @@ -616,7 +617,8 @@ class Chat(Object): can_restrict_members: bool = True, can_invite_users: bool = True, can_pin_messages: bool = False, - can_promote_members: bool = False + can_promote_members: bool = False, + can_manage_voice_chats: bool = False ) -> bool: """Bound method *promote_member* of :obj:`~pyrogram.types.Chat`. @@ -640,6 +642,11 @@ class Chat(Object): 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). + can_manage_chat (``bool``, *optional*): + Pass True, if the administrator can access the chat event log, chat statistics, message statistics + in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. + Implied by any other administrator privilege. + can_change_info (``bool``, *optional*): Pass True, if the administrator can change chat title, photo and other settings. @@ -666,6 +673,9 @@ class Chat(Object): demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him). + can_manage_voice_chats (``bool``, *optional*): + Pass True, if the administration can manage voice chats (also called group calls). + Returns: ``bool``: True on success. @@ -676,6 +686,7 @@ class Chat(Object): return await self._client.promote_chat_member( chat_id=self.id, user_id=user_id, + can_manage_chat=can_manage_chat, can_change_info=can_change_info, can_post_messages=can_post_messages, can_edit_messages=can_edit_messages, @@ -683,7 +694,8 @@ class Chat(Object): can_restrict_members=can_restrict_members, can_invite_users=can_invite_users, can_pin_messages=can_pin_messages, - can_promote_members=can_promote_members + can_promote_members=can_promote_members, + can_manage_voice_chats=can_manage_voice_chats ) async def join(self):