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_PARSE_MODE, entities: Optional[List[MessageEntity]] = None, disable_web_page_preview: Optional[bool] = sentinel.UNSET_DISABLE_WEB_PAGE_PREVIEW, reply_markup: Optional[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, otherwiseTrue
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[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[InlineKeyboardMarkup]#
A JSON-serialized object for an inline keyboard.
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(...)