added parameter "can_manage_topics" for "promoteChatMember" method

This commit is contained in:
ZeN 2022-11-05 16:21:15 +03:00
parent 3ae5d904c9
commit 5b169647e8
No known key found for this signature in database
GPG key ID: ED6378D93306FB20
2 changed files with 5 additions and 0 deletions

View file

@ -1641,6 +1641,7 @@ class Bot(ContextInstanceMixin["Bot"]):
can_change_info: Optional[bool] = None,
can_invite_users: Optional[bool] = None,
can_pin_messages: Optional[bool] = None,
can_manage_topics: Optional[bool] = None,
request_timeout: Optional[int] = None,
) -> bool:
"""
@ -1661,6 +1662,7 @@ class Bot(ContextInstanceMixin["Bot"]):
:param can_change_info: Pass :code:`True` if the administrator can change chat title, photo and other settings
:param can_invite_users: Pass :code:`True` if the administrator can invite new users to the chat
:param can_pin_messages: Pass :code:`True` if the administrator can pin messages, supergroups only
:param can_manage_topics: Pass :code: `True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
:param request_timeout: Request timeout
:return: Returns True on success.
"""
@ -1678,6 +1680,7 @@ class Bot(ContextInstanceMixin["Bot"]):
can_change_info=can_change_info,
can_invite_users=can_invite_users,
can_pin_messages=can_pin_messages,
can_manage_topics=can_manage_topics,
)
return await self(call, request_timeout=request_timeout)

View file

@ -43,6 +43,8 @@ class PromoteChatMember(TelegramMethod[bool]):
"""Pass :code:`True` if the administrator can invite new users to the chat"""
can_pin_messages: Optional[bool] = None
"""Pass :code:`True` if the administrator can pin messages, supergroups only"""
can_manage_topics: Optional[bool] = None
"""Pass :code:`True` if the user is allowed to create, rename, close, and reopen forum topics, supergroups only"""
def build_request(self, bot: Bot) -> Request:
data: Dict[str, Any] = self.dict()