mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
parent
b071570654
commit
8bf80a15b3
2 changed files with 30 additions and 0 deletions
|
|
@ -268,6 +268,7 @@ class Methods(Helper):
|
|||
SET_MY_COMMANDS = Item() # setMyCommands
|
||||
DELETE_MY_COMMANDS = Item() # deleteMyCommands
|
||||
GET_MY_COMMANDS = Item() # getMyCommands
|
||||
SET_MY_DESCRIPTION = Item() # setMyDescription
|
||||
|
||||
# Updating messages
|
||||
EDIT_MESSAGE_TEXT = Item() # editMessageText
|
||||
|
|
|
|||
|
|
@ -2983,6 +2983,35 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
result = await self.request(api.Methods.GET_MY_COMMANDS, payload)
|
||||
return [types.BotCommand(**bot_command_data) for bot_command_data in result]
|
||||
|
||||
async def set_my_description(
|
||||
self,
|
||||
description: typing.Optional[base.String] = None,
|
||||
language_code: typing.Optional[base.String] = None,
|
||||
) -> base.Boolean:
|
||||
"""
|
||||
Use this method to change the bot's description, which is shown
|
||||
in the chat with the bot if the chat is empty.
|
||||
|
||||
|
||||
Source: https://core.telegram.org/bots/api#setmydescription
|
||||
|
||||
:param description: New bot description; 0-512 characters.
|
||||
Pass an empty string to remove the dedicated description for
|
||||
the given language.
|
||||
:type description: :obj: `typing.Optional[base.String]`
|
||||
|
||||
:param language_code: A two-letter ISO 639-1 language code. If
|
||||
empty, the description will be applied to all users for
|
||||
whose language there is no dedicated 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_DESCRIPTION, payload)
|
||||
|
||||
async def set_chat_menu_button(self, chat_id: typing.Optional[base.Integer] = None,
|
||||
menu_button: typing.Optional[types.MenuButton] = None) -> bool:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue