diff --git a/aiogram/bot/api.py b/aiogram/bot/api.py index c74458a1..a1f465db 100644 --- a/aiogram/bot/api.py +++ b/aiogram/bot/api.py @@ -269,6 +269,7 @@ class Methods(Helper): DELETE_MY_COMMANDS = Item() # deleteMyCommands GET_MY_COMMANDS = Item() # getMyCommands SET_MY_DESCRIPTION = Item() # setMyDescription + GET_MY_DESCRIPTION = Item() # getMyDescription # Updating messages EDIT_MESSAGE_TEXT = Item() # editMessageText diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index 49549108..1ae1e033 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -3012,6 +3012,28 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): return await self.request(api.Methods.SET_MY_DESCRIPTION, payload) + async def get_my_description( + self, + language_code: typing.Optional[base.String] = None, + ) -> types.BotDescription: + """ + Use this method to get the current bot description for the given + user language. + + Source: https://core.telegram.org/bots/api#getmydescription + + :param language_code: A two-letter ISO 639-1 language code or an + empty string + :type language_code: :obj: `typing.Optional[base.String]` + + :return: Returns BotDescription on success. + :rtype: :obj:`types.BotDescription` + """ + payload = generate_payload(**locals()) + + result = await self.request(api.Methods.GET_MY_DESCRIPTION, payload) + return types.BotDescription(**result) + async def set_chat_menu_button(self, chat_id: typing.Optional[base.Integer] = None, menu_button: typing.Optional[types.MenuButton] = None) -> bool: """ diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 9d99880f..b382c215 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -8,6 +8,7 @@ from .bot_command_scope import BotCommandScope, BotCommandScopeAllChatAdministra BotCommandScopeAllGroupChats, BotCommandScopeAllPrivateChats, BotCommandScopeChat, \ BotCommandScopeChatAdministrators, BotCommandScopeChatMember, \ BotCommandScopeDefault, BotCommandScopeType +from .bot_description import BotDescription from .callback_game import CallbackGame from .callback_query import CallbackQuery from .chat import Chat, ChatActions, ChatType @@ -118,6 +119,7 @@ __all__ = ( 'BotCommandScopeChatMember', 'BotCommandScopeDefault', 'BotCommandScopeType', + 'BotDescription', 'CallbackGame', 'CallbackQuery', 'Chat', diff --git a/aiogram/types/bot_description.py b/aiogram/types/bot_description.py new file mode 100644 index 00000000..d08c6e46 --- /dev/null +++ b/aiogram/types/bot_description.py @@ -0,0 +1,10 @@ +from . import base, fields + + +class BotDescription(base.TelegramObject): + """ + This object represents the bot's description. + + https://core.telegram.org/bots/api#botdescription + """ + description: base.String = fields.Field()