mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
parent
8bf80a15b3
commit
1667a4d46e
4 changed files with 35 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
10
aiogram/types/bot_description.py
Normal file
10
aiogram/types/bot_description.py
Normal file
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue