Message.edit_caption()

Message.edit_caption()

Bound method edit_caption of Message.

Use as a shortcut for:

await client.edit_message_caption(
    chat_id=message.chat.id,
    message_id=message.id,
    caption="hello"
)

Example

await message.edit_caption("hello")
Parameters:
  • caption (str) – New caption of the message.

  • parse_mode (ParseMode, optional) – By default, texts are parsed using both Markdown and HTML styles. You can combine both syntaxes together.

  • caption_entities (List of MessageEntity) – List of special entities that appear in the caption, which can be specified instead of parse_mode.

  • invert_media (bool, optional) – Inverts the position of the media and caption.

  • reply_markup (InlineKeyboardMarkup, optional) – An InlineKeyboardMarkup object.

  • business_connection_id (str, optional) – Unique identifier of the business connection. for business bots only.

Returns:

On success, the edited Message is returned.

Raises:

RPCError – In case of a Telegram RPC error.