From e253edbe52b039330c5406d539a6811f7795065a Mon Sep 17 00:00:00 2001 From: Mustafa Asaad Date: Thu, 12 May 2022 16:59:15 +0300 Subject: [PATCH] Renamed the parameter can_manage_voice_chats to can_manage_video_chats in the method promoteChatMember. The old parameter will remain temporarily available. --- tgbotapi/asyncbot.py | 4 ++-- tgbotapi/bot.py | 6 +++--- tgbotapi/methods.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tgbotapi/asyncbot.py b/tgbotapi/asyncbot.py index 9f3c18f..f0fb4b7 100644 --- a/tgbotapi/asyncbot.py +++ b/tgbotapi/asyncbot.py @@ -285,11 +285,11 @@ def restrict_chat_member(self, chat_id, user_id, permissions, until_date=None): @async_handler() def promote_chat_member(self, chat_id, user_id, is_anonymous=False, can_manage_chat=False, can_change_info=False, can_post_messages=False, can_edit_messages=False, can_delete_messages=False, - can_manage_voice_chats=False, can_invite_users=False, can_restrict_members=False, + can_manage_video_chats=False, can_invite_users=False, can_restrict_members=False, can_pin_messages=False, can_promote_members=False): return Bot.promote_chat_member(self, chat_id, user_id, is_anonymous, can_manage_chat, can_change_info, can_post_messages, can_edit_messages, can_delete_messages, - can_manage_voice_chats, can_invite_users, can_restrict_members, can_pin_messages, + can_manage_video_chats, can_invite_users, can_restrict_members, can_pin_messages, can_promote_members) @async_handler() diff --git a/tgbotapi/bot.py b/tgbotapi/bot.py index 15c9688..0f0a116 100644 --- a/tgbotapi/bot.py +++ b/tgbotapi/bot.py @@ -998,7 +998,7 @@ def restrict_chat_member(self, chat_id, user_id, permissions, until_date=None): def promote_chat_member(self, chat_id, user_id, is_anonymous=False, can_manage_chat=False, can_change_info=False, can_post_messages=False, can_edit_messages=False, can_delete_messages=False, - can_manage_voice_chats=False, can_invite_users=False, can_restrict_members=False, + can_manage_video_chats=False, can_invite_users=False, can_restrict_members=False, can_pin_messages=False, can_promote_members=False): """ Use this method to promote or demote a user in a supergroup or a channel @@ -1013,7 +1013,7 @@ def promote_chat_member(self, chat_id, user_id, is_anonymous=False, can_manage_c :param bool can_edit_messages: Pass True, if the administrator can edit messages of other users and can pin messages, channels only :param bool can_delete_messages: Pass True, if the administrator can delete messages of other users - :param bool can_manage_voice_chats: True, if the administrator can manage voice chats + :param bool can_manage_video_chats: True, if the administrator can manage voice chats :param bool can_invite_users: Pass True, if the administrator can invite new users to the chat :param bool can_restrict_members: Pass True, if the administrator can restrict, ban or unban chat members :param bool can_pin_messages: Pass True, if the administrator can pin messages, supergroups only @@ -1025,7 +1025,7 @@ def promote_chat_member(self, chat_id, user_id, is_anonymous=False, can_manage_c """ return methods.promote_chat_member(self.__api_url, self.__proxies, chat_id, user_id, is_anonymous, can_manage_chat, can_change_info, can_post_messages, can_edit_messages, - can_delete_messages, can_delete_messages, can_invite_users, + can_delete_messages, can_manage_video_chats, can_invite_users, can_restrict_members, can_pin_messages, can_promote_members) def set_chat_administrator_custom_title(self, chat_id, user_id, custom_title): diff --git a/tgbotapi/methods.py b/tgbotapi/methods.py index 5bfa2c1..88ba22c 100644 --- a/tgbotapi/methods.py +++ b/tgbotapi/methods.py @@ -1092,7 +1092,7 @@ def restrict_chat_member(based_url, proxies, chat_id, user_id, permissions, unti def promote_chat_member(based_url, proxies, chat_id, user_id, is_anonymous, can_manage_chat, can_change_info, - can_post_messages, can_edit_messages, can_delete_messages, can_manage_voice_chats, + can_post_messages, can_edit_messages, can_delete_messages, can_manage_video_chats, can_invite_users, can_restrict_members, can_pin_messages, can_promote_members): """ Use this method to promote or demote a user in a supergroup or a channel @@ -1106,7 +1106,7 @@ def promote_chat_member(based_url, proxies, chat_id, user_id, is_anonymous, can_ :type can_post_messages: bool :type can_edit_messages: bool :type can_delete_messages: bool - :type can_manage_voice_chats: bool + :type can_manage_video_chats: bool :type can_invite_users: bool :type can_restrict_members: bool :type can_pin_messages: bool @@ -1128,8 +1128,8 @@ def promote_chat_member(based_url, proxies, chat_id, user_id, is_anonymous, can_ params['can_post_messages'] = can_post_messages if can_edit_messages: params['can_edit_messages'] = can_edit_messages - if can_manage_voice_chats: - params['can_manage_voice_chats'] = can_manage_voice_chats + if can_manage_video_chats: + params['can_manage_video_chats'] = can_manage_video_chats if can_delete_messages: params['can_delete_messages'] = can_delete_messages if can_invite_users: