send_rich_message()¶
- Client.send_rich_message()¶
Send a rich formatted message.
Usable by Users Bots- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target chat.rich_message (
InputRichMessage) – Rich message content to send.reply_to_message_id (
int, optional) – Message ID to reply to.message_thread_id (
int, optional) – Forum topic ID for threaded messages.reply_markup (
InlineKeyboardMarkup, optional) – Inline keyboard markup.schedule_date (
datetime, optional) – Date when the message will be automatically sent.silent (
bool, optional) – Send silently (no notification).protect_content (
bool, optional) – Prevent message forwarding.
- Returns:
Message– On success, the sent message is returned.
Example
from pyrogram.raw import types as raw_types from pyrogram.types import InputRichMessage await app.send_rich_message( chat_id, InputRichMessage(blocks=[ raw_types.PageBlockParagraph( text=raw_types.TextPlain(text="Hello, rich world!") ) ]) )