InputTextMessageContent

class telegram.InputTextMessageContent(message_text, parse_mode=None, entities=None, link_preview_options=None, *, disable_web_page_preview=None, api_kwargs=None)[source]

Bases: telegram.InputMessageContent

Represents the content of a text message to be sent as the result of an inline query.

Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their message_text is equal.

Examples

Inline Bot

Parameters:
Keyword Arguments:

disable_web_page_preview (bool, optional) –

Disables link previews for links in the sent message. Convenience parameter for setting link_preview_options. Mutually exclusive with link_preview_options.

Changed in version 20.8: Bot API 7.0 introduced link_preview_options replacing this argument. PTB will automatically convert this argument to that one, but for advanced options, please use link_preview_options directly.

Changed in version 21.0: This argument is now a keyword-only argument.

message_text[source]

Text of the message to be sent, 1- 4096 characters after entities parsing.

Type:

str

parse_mode[source]

Optional. Mode for parsing entities. See telegram.constants.ParseMode and formatting options for more details.

Type:

str

entities[source]

Optional. Tuple of special entities that appear in the caption, which can be specified instead of parse_mode.

Changed in version 20.0:

  • This attribute is now an immutable tuple.

  • This attribute is now always a tuple, that may be empty.

Type:

Tuple[telegram.MessageEntity]

Optional. Link preview generation options for the message.

New in version 20.8.

Type:

LinkPreviewOptions