Telegram Bot API 4.5

This commit is contained in:
Alex Root Junior 2020-01-11 19:47:39 +02:00
parent d2606b389a
commit ffb0cdf88f
39 changed files with 146 additions and 37 deletions

View file

@ -55,6 +55,7 @@ from ..methods import (
SendVideo,
SendVideoNote,
SendVoice,
SetChatAdministratorCustomTitle,
SetChatDescription,
SetChatPermissions,
SetChatPhoto,
@ -1204,6 +1205,27 @@ class Bot(BaseBot):
)
return await self.emit(call)
async def set_chat_administrator_custom_title(
self, chat_id: Union[int, str], user_id: int, custom_title: str,
) -> bool:
"""
Use this method to set a custom title for an administrator in a supergroup promoted by the
bot. Returns True on success.
Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
:param chat_id: Unique identifier for the target chat or username of the target supergroup
(in the format @supergroupusername)
:param user_id: Unique identifier of the target user
:param custom_title: New custom title for the administrator; 0-16 characters, emoji are
not allowed
:return: Returns True on success.
"""
call = SetChatAdministratorCustomTitle(
chat_id=chat_id, user_id=user_id, custom_title=custom_title,
)
return await self.emit(call)
async def set_chat_permissions(
self, chat_id: Union[int, str], permissions: ChatPermissions
) -> bool: