mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Added can_manage_topics for promotechatmember
Added the parameter can_manage_topics to the method promoteChatMember.
This commit is contained in:
parent
4e2ea90db3
commit
7958d0dca7
@ -2910,7 +2910,8 @@ class TeleBot:
|
||||
is_anonymous: Optional[bool]=None,
|
||||
can_manage_chat: Optional[bool]=None,
|
||||
can_manage_video_chats: Optional[bool]=None,
|
||||
can_manage_voice_chats: Optional[bool]=None) -> bool:
|
||||
can_manage_voice_chats: Optional[bool]=None,
|
||||
can_manage_topics: Optional[bool]=None) -> bool:
|
||||
"""
|
||||
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator
|
||||
in the chat for this to work and must have the appropriate admin rights.
|
||||
@ -2967,6 +2968,10 @@ class TeleBot:
|
||||
:param can_manage_voice_chats: Deprecated, use can_manage_video_chats.
|
||||
:type can_manage_voice_chats: :obj:`bool`
|
||||
|
||||
:param can_manage_topics: Pass True if the user is allowed to create, rename, close,
|
||||
and reopen forum topics, supergroups only
|
||||
:type can_manage_topics: :obj:`bool`
|
||||
|
||||
:return: True on success.
|
||||
:rtype: :obj:`bool`
|
||||
"""
|
||||
@ -2979,7 +2984,7 @@ class TeleBot:
|
||||
self.token, chat_id, user_id, can_change_info, can_post_messages,
|
||||
can_edit_messages, can_delete_messages, can_invite_users,
|
||||
can_restrict_members, can_pin_messages, can_promote_members,
|
||||
is_anonymous, can_manage_chat, can_manage_video_chats)
|
||||
is_anonymous, can_manage_chat, can_manage_video_chats, can_manage_topics)
|
||||
|
||||
def set_chat_administrator_custom_title(
|
||||
self, chat_id: Union[int, str], user_id: int, custom_title: str) -> bool:
|
||||
|
@ -977,7 +977,8 @@ def promote_chat_member(
|
||||
token, chat_id, user_id, can_change_info=None, can_post_messages=None,
|
||||
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
|
||||
can_restrict_members=None, can_pin_messages=None, can_promote_members=None,
|
||||
is_anonymous=None, can_manage_chat=None, can_manage_video_chats=None):
|
||||
is_anonymous=None, can_manage_chat=None, can_manage_video_chats=None,
|
||||
can_manage_topics=None):
|
||||
method_url = 'promoteChatMember'
|
||||
payload = {'chat_id': chat_id, 'user_id': user_id}
|
||||
if can_change_info is not None:
|
||||
@ -1002,6 +1003,8 @@ def promote_chat_member(
|
||||
payload['can_manage_chat'] = can_manage_chat
|
||||
if can_manage_video_chats is not None:
|
||||
payload['can_manage_video_chats'] = can_manage_video_chats
|
||||
if can_manage_topics is not None:
|
||||
payload['can_manage_topics'] = can_manage_topics
|
||||
return _make_request(token, method_url, params=payload, method='post')
|
||||
|
||||
|
||||
|
@ -3750,7 +3750,8 @@ class AsyncTeleBot:
|
||||
is_anonymous: Optional[bool]=None,
|
||||
can_manage_chat: Optional[bool]=None,
|
||||
can_manage_video_chats: Optional[bool]=None,
|
||||
can_manage_voice_chats: Optional[bool]=None) -> bool:
|
||||
can_manage_voice_chats: Optional[bool]=None,
|
||||
can_manage_topics: Optional[bool]=None) -> bool:
|
||||
"""
|
||||
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator
|
||||
in the chat for this to work and must have the appropriate admin rights.
|
||||
@ -3807,6 +3808,10 @@ class AsyncTeleBot:
|
||||
:param can_manage_voice_chats: Deprecated, use can_manage_video_chats.
|
||||
:type can_manage_voice_chats: :obj:`bool`
|
||||
|
||||
:param can_manage_topics: Pass True if the user is allowed to create, rename, close,
|
||||
and reopen forum topics, supergroups only
|
||||
:type can_manage_topics: :obj:`bool`
|
||||
|
||||
:return: True on success.
|
||||
:rtype: :obj:`bool`
|
||||
"""
|
||||
@ -3820,7 +3825,7 @@ class AsyncTeleBot:
|
||||
self.token, chat_id, user_id, can_change_info, can_post_messages,
|
||||
can_edit_messages, can_delete_messages, can_invite_users,
|
||||
can_restrict_members, can_pin_messages, can_promote_members,
|
||||
is_anonymous, can_manage_chat, can_manage_video_chats)
|
||||
is_anonymous, can_manage_chat, can_manage_video_chats, can_manage_topics)
|
||||
|
||||
async def set_chat_administrator_custom_title(
|
||||
self, chat_id: Union[int, str], user_id: int, custom_title: str) -> bool:
|
||||
|
@ -968,7 +968,7 @@ async def promote_chat_member(
|
||||
token, chat_id, user_id, can_change_info=None, can_post_messages=None,
|
||||
can_edit_messages=None, can_delete_messages=None, can_invite_users=None,
|
||||
can_restrict_members=None, can_pin_messages=None, can_promote_members=None,
|
||||
is_anonymous=None, can_manage_chat=None, can_manage_video_chats=None):
|
||||
is_anonymous=None, can_manage_chat=None, can_manage_video_chats=None, can_manage_topics=None):
|
||||
method_url = 'promoteChatMember'
|
||||
payload = {'chat_id': chat_id, 'user_id': user_id}
|
||||
if can_change_info is not None:
|
||||
@ -993,6 +993,8 @@ async def promote_chat_member(
|
||||
payload['can_manage_chat'] = can_manage_chat
|
||||
if can_manage_video_chats is not None:
|
||||
payload['can_manage_video_chats'] = can_manage_video_chats
|
||||
if can_manage_topics is not None:
|
||||
payload['can_manage_topics'] = can_manage_topics
|
||||
return await _process_request(token, method_url, params=payload, method='post')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user