diff --git a/aiogram/bot/api.py b/aiogram/bot/api.py index 9d38559b..2c0054bb 100644 --- a/aiogram/bot/api.py +++ b/aiogram/bot/api.py @@ -271,6 +271,7 @@ class Methods(Helper): SET_MY_DESCRIPTION = Item() # setMyDescription GET_MY_DESCRIPTION = Item() # getMyDescription SET_MY_SHORT_DESCRIPTION = Item() # setMyShortDescription + GET_MY_SHORT_DESCRIPTION = Item() # getMyShortDescription # Updating messages EDIT_MESSAGE_TEXT = Item() # editMessageText diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index 86746687..c577db40 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -3063,6 +3063,28 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): return await self.request(api.Methods.SET_MY_SHORT_DESCRIPTION, payload) + async def get_my_short_description( + self, + language_code: typing.Optional[base.String] = None, + ) -> types.BotShortDescription: + """ + Use this method to get the current bot short description for the + given user language. + + Source: https://core.telegram.org/bots/api#getmyshortdescription + + :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 BotShortDescription on success. + :rtype: :obj:`types.BotShortDescription` + """ + payload = generate_payload(**locals()) + + result = await self.request(api.Methods.GET_MY_SHORT_DESCRIPTION, payload) + return types.BotShortDescription(**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 b382c215..da2ba1ac 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -9,6 +9,7 @@ from .bot_command_scope import BotCommandScope, BotCommandScopeAllChatAdministra BotCommandScopeChatAdministrators, BotCommandScopeChatMember, \ BotCommandScopeDefault, BotCommandScopeType from .bot_description import BotDescription +from .bot_short_description import BotShortDescription from .callback_game import CallbackGame from .callback_query import CallbackQuery from .chat import Chat, ChatActions, ChatType @@ -120,6 +121,7 @@ __all__ = ( 'BotCommandScopeDefault', 'BotCommandScopeType', 'BotDescription', + 'BotShortDescription', 'CallbackGame', 'CallbackQuery', 'Chat', diff --git a/aiogram/types/bot_short_description.py b/aiogram/types/bot_short_description.py new file mode 100644 index 00000000..218e8270 --- /dev/null +++ b/aiogram/types/bot_short_description.py @@ -0,0 +1,10 @@ +from . import base, fields + + +class BotShortDescription(base.TelegramObject): + """ + This object represents the bot's short description. + + https://core.telegram.org/bots/api#botshortdescription + """ + short_description: base.String = fields.Field()