Skip to content

Commit a86656a

Browse files
committed
Update Pyrogram to 1.2.4
Add missing parameters to chat.promote_member
1 parent 97bb996 commit a86656a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

pyrogram/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
__version__ = "1.2.3"
19+
__version__ = "1.2.4"
2020
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
2121
__copyright__ = "Copyright (C) 2017-2021 Dan <https://github.com/delivrance>"
2222

pyrogram/types/user_and_chats/chat.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,14 +609,16 @@ async def restrict_member(
609609
async def promote_member(
610610
self,
611611
user_id: Union[int, str],
612+
can_manage_chat: bool = True,
612613
can_change_info: bool = True,
613614
can_post_messages: bool = False,
614615
can_edit_messages: bool = False,
615616
can_delete_messages: bool = True,
616617
can_restrict_members: bool = True,
617618
can_invite_users: bool = True,
618619
can_pin_messages: bool = False,
619-
can_promote_members: bool = False
620+
can_promote_members: bool = False,
621+
can_manage_voice_chats: bool = False
620622
) -> bool:
621623
"""Bound method *promote_member* of :obj:`~pyrogram.types.Chat`.
622624
@@ -640,6 +642,11 @@ async def promote_member(
640642
Unique identifier (int) or username (str) of the target user.
641643
For a contact that exists in your Telegram address book you can use his phone number (str).
642644
645+
can_manage_chat (``bool``, *optional*):
646+
Pass True, if the administrator can access the chat event log, chat statistics, message statistics
647+
in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode.
648+
Implied by any other administrator privilege.
649+
643650
can_change_info (``bool``, *optional*):
644651
Pass True, if the administrator can change chat title, photo and other settings.
645652
@@ -666,6 +673,9 @@ async def promote_member(
666673
demote administrators that he has promoted, directly or indirectly (promoted by administrators that
667674
were appointed by him).
668675
676+
can_manage_voice_chats (``bool``, *optional*):
677+
Pass True, if the administration can manage voice chats (also called group calls).
678+
669679
Returns:
670680
``bool``: True on success.
671681
@@ -676,14 +686,16 @@ async def promote_member(
676686
return await self._client.promote_chat_member(
677687
chat_id=self.id,
678688
user_id=user_id,
689+
can_manage_chat=can_manage_chat,
679690
can_change_info=can_change_info,
680691
can_post_messages=can_post_messages,
681692
can_edit_messages=can_edit_messages,
682693
can_delete_messages=can_delete_messages,
683694
can_restrict_members=can_restrict_members,
684695
can_invite_users=can_invite_users,
685696
can_pin_messages=can_pin_messages,
686-
can_promote_members=can_promote_members
697+
can_promote_members=can_promote_members,
698+
can_manage_voice_chats=can_manage_voice_chats
687699
)
688700

689701
async def join(self):

0 commit comments

Comments
 (0)