editMessageCaption#

Returns: Union[Message, bool]

class aiogram.methods.edit_message_caption.EditMessageCaption(*, chat_id: Optional[Union[int, str]] = None, message_id: Optional[int] = None, inline_message_id: Optional[str] = None, caption: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, reply_markup: Optional[aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup] = None, **extra_data: Any)[source]#

Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited aiogram.types.message.Message is returned, otherwise True is returned.

Source: https://core.telegram.org/bots/api#editmessagecaption

chat_id: Optional[Union[int, str]]#

Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

message_id: Optional[int]#

Required if inline_message_id is not specified. Identifier of the message to edit

inline_message_id: Optional[str]#

Required if chat_id and message_id are not specified. Identifier of the inline message

caption: Optional[str]#

New caption of the message, 0-1024 characters after entities parsing

parse_mode: Optional[str]#

Mode for parsing entities in the message caption. See formatting options for more details.

caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]]#

A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markup: Optional[aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup]#

A JSON-serialized object for an inline keyboard.

build_request(bot: Bot) Request[source]#

Usage#

As bot method#

result: Union[Message, bool] = await bot.edit_message_caption(...)

Method as object#

Imports:

  • from aiogram.methods.edit_message_caption import EditMessageCaption

  • alias: from aiogram.methods import EditMessageCaption

With specific bot#

result: Union[Message, bool] = await bot(EditMessageCaption(...))

As reply into Webhook in handler#

return EditMessageCaption(...)