forked from pyrogram/pyrogram
-
Notifications
You must be signed in to change notification settings - Fork 1
Message methods
Lelzin λ edited this page Sep 3, 2024
·
2 revisions
Parameters:
- text (
str
): Text of the message to be sent. - quote (
bool
, optional): IfTrue
, the message will be sent as a reply to this message. If reply_to_message_id is passed, this parameter will be ignored. Defaults toTrue
in group chats andFalse
in private chats. - same_chat (
bool
, optional): Filters update by the user that sent message. Defaults toTrue
. - same_user (
bool
, optional): Filters update by the chat that the user sent a message. Defaults toTrue
. - same_message_id (
bool
, optional): Filters update by themessage_id
that the bot sent a message. It works only if type parameter - receivesCallbackQuery
Defaults toTrue
. - type (
Update
, optional): Update type that must be expected. Defaults toMessage
. - parse_mode (
ParseMode
, optional): By default, texts are parsed using both Markdown and HTML styles. You can combine both syntaxes together. - entities (List of
MessageEntity
): List of special entities that appear in message text, which can be specified instead of parse_mode. - 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. - reply_to_message_id (
int
, optional): If the message is a reply, ID of the original message. - schedule_date (
datetime.datetime
, optional): Date when the message will be automatically sent. - protect_content (
bool
, optional): Protects the contents of the sent message from forwarding and saving. - 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.
Yields:
On success, the sent Message and the update is yielded. Tuple
[Message
, Message
]
Raises:
-
RPCError
: In case of a Telegram RPC error. -
TimeoutError
: In case of timeout reached.