editMessageText#

Returns: Union[Message, bool]

class aiogram.methods.edit_message_text.EditMessageText(*, text: str, chat_id: Optional[Union[int, str]] = None, message_id: Optional[int] = None, inline_message_id: Optional[str] = None, parse_mode: Optional[str] = sentinel.UNSET, entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, disable_web_page_preview: Optional[bool] = None, reply_markup: Optional[aiogram.types.inline_keyboard_markup.InlineKeyboardMarkup] = None, **extra_data: Any)[source]#

Use this method to edit text and game 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#editmessagetext

text: str#

New text of the message, 1-4096 characters after entities parsing

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

parse_mode: Optional[str]#

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

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

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

disable_web_page_preview: Optional[bool]#

Disables link previews for links in this message

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_text(...)

Method as object#

Imports:

  • from aiogram.methods.edit_message_text import EditMessageText

  • alias: from aiogram.methods import EditMessageText

With specific bot#

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

As reply into Webhook in handler#

return EditMessageText(...)