feat: add setMyShortDescription

#1140
This commit is contained in:
Oleg A 2023-03-09 21:46:55 +03:00
parent 1667a4d46e
commit ef1d4ae94d
No known key found for this signature in database
GPG key ID: 5FE046817A9657C5
2 changed files with 30 additions and 0 deletions

View file

@ -270,6 +270,7 @@ class Methods(Helper):
GET_MY_COMMANDS = Item() # getMyCommands
SET_MY_DESCRIPTION = Item() # setMyDescription
GET_MY_DESCRIPTION = Item() # getMyDescription
SET_MY_SHORT_DESCRIPTION = Item() # setMyShortDescription
# Updating messages
EDIT_MESSAGE_TEXT = Item() # editMessageText

View file

@ -3034,6 +3034,35 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
result = await self.request(api.Methods.GET_MY_DESCRIPTION, payload)
return types.BotDescription(**result)
async def set_my_short_description(
self,
short_description: typing.Optional[base.String] = None,
language_code: typing.Optional[base.String] = None,
) -> base.Boolean:
"""
Use this method to change the bot's short description, which is
shown on the bot's profile page and is sent together with the
link when users share the bot.
Source: https://core.telegram.org/bots/api#setmyshortdescription
:param short_description: New short description for the bot;
0-120 characters. Pass an empty string to remove the
dedicated short description for the given language.
:type short_description: :obj: `typing.Optional[base.String]`
:param language_code: A two-letter ISO 639-1 language code. If
empty, the short description will be applied to all users
for whose language there is no dedicated short description.
:type language_code: :obj: `typing.Optional[base.String]`
:return: Returns True on success.
:rtype: :obj:`base.Boolean`
"""
payload = generate_payload(**locals())
return await self.request(api.Methods.SET_MY_SHORT_DESCRIPTION, payload)
async def set_chat_menu_button(self, chat_id: typing.Optional[base.Integer] = None,
menu_button: typing.Optional[types.MenuButton] = None) -> bool:
"""