Message.answer_rich()

async Message.answer_rich()[source]

Shortcut for method send_rich_message will automatically fill method attributes:

  • chat_id

  • message_thread_id

  • direct_messages_topic_id

  • business_connection_id

  • ephemeral_message_parameters

Unlike reply_rich(), this method does not reply to the message it is bound to.

Example:
await message.answer_rich("# Title

Some rich text”)

Parameters:
rich_text (str | InputRichMessage):

Rich text (Markdown or HTML) to render a styled message, or a whole InputRichMessage describing it.

parse_mode (ParseMode, optional):

By default, texts are parsed as Markdown. Pass HTML to parse them as HTML instead; the two styles are exclusive and cannot be combined. Ignored when rich_text is an InputRichMessage.

media (List of InputRichMessageMedia, optional):

Media the text refers to through tg://photo?id=, tg://video?id= or tg://audio?id= links. Ignored when rich_text is an InputRichMessage.

disable_web_page_preview (bool, optional):

Disables link previews for links in this message.

disable_notification (bool, optional):

Sends the message silently. Users will receive a notification with no sound.

message_thread_id (int, optional):

Unique identifier for a message thread in a forum topic.

direct_messages_topic_id (int, optional):

Unique identifier of the direct messages topic.

effect_id (int, optional):

Unique identifier of the effect to apply to the message.

show_caption_above_media (bool, optional):

Pass True, if the caption must be shown above the message media.

reply_parameters (ReplyParameters, optional):

Describes reply parameters for the message that is being sent.

schedule_date (datetime, optional):

Date when the message will be automatically sent.

repeat_period (int, optional):

Period in seconds for the message to be sent repeatedly.

protect_content (bool, optional):

Pass True to protect the message content from being forwarded.

allow_paid_broadcast (bool, optional):

Pay to skip the broadcast flood limit.

paid_message_star_count (int, optional):

The number of Telegram Stars the user agreed to pay to send the message.

suggested_post_parameters (SuggestedPostParameters, optional):

Parameters of the suggested post.

reply_markup (InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply, optional):

Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Returns:

Message: On success, the sent message is returned.

Raises:

RPCError: In case of a Telegram RPC error.