From 570195a77376a21c99147db21fe2e5e72fddf9ed Mon Sep 17 00:00:00 2001 From: wulan17 Date: Sun, 29 Oct 2023 12:15:55 +0700 Subject: [PATCH] Pyrofork: Add Quote Signed-off-by: wulan17 --- .../methods/bots/send_inline_bot_result.py | 9 +- pyrogram/methods/messages/send_animation.py | 7 +- pyrogram/methods/messages/send_audio.py | 7 +- .../methods/messages/send_cached_media.py | 7 +- pyrogram/methods/messages/send_contact.py | 7 +- pyrogram/methods/messages/send_dice.py | 7 +- pyrogram/methods/messages/send_document.py | 7 +- pyrogram/methods/messages/send_location.py | 7 +- pyrogram/methods/messages/send_media_group.py | 7 +- pyrogram/methods/messages/send_message.py | 7 +- pyrogram/methods/messages/send_photo.py | 7 +- pyrogram/methods/messages/send_poll.py | 7 +- pyrogram/methods/messages/send_sticker.py | 7 +- pyrogram/methods/messages/send_venue.py | 7 +- pyrogram/methods/messages/send_video.py | 7 +- pyrogram/methods/messages/send_video_note.py | 7 +- pyrogram/methods/messages/send_voice.py | 7 +- .../input_reply_to_message.py | 7 +- pyrogram/types/messages_and_media/message.py | 104 +++++++++++++++++- 19 files changed, 208 insertions(+), 24 deletions(-) diff --git a/pyrogram/methods/bots/send_inline_bot_result.py b/pyrogram/methods/bots/send_inline_bot_result.py index 1ee5df4c..33722357 100644 --- a/pyrogram/methods/bots/send_inline_bot_result.py +++ b/pyrogram/methods/bots/send_inline_bot_result.py @@ -31,7 +31,8 @@ class SendInlineBotResult: result_id: str, disable_notification: bool = None, message_thread_id: int = None, - reply_to_message_id: int = None + reply_to_message_id: int = None, + quote_text: str = None ) -> "raw.base.Updates": """Send an inline bot result. Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results` @@ -61,6 +62,10 @@ class SendInlineBotResult: reply_to_message_id (``bool``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + Returns: :obj:`~pyrogram.raw.base.Updates`: Currently, on success, a raw result is returned. @@ -72,7 +77,7 @@ class SendInlineBotResult: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) return await self.invoke( raw.functions.messages.SendInlineBotResult( diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index bff8593b..9ac75d80 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -50,6 +50,7 @@ class SendAnimation: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -128,6 +129,10 @@ class SendAnimation: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -187,7 +192,7 @@ class SendAnimation: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_audio.py b/pyrogram/methods/messages/send_audio.py index a554a1ce..89fe077b 100644 --- a/pyrogram/methods/messages/send_audio.py +++ b/pyrogram/methods/messages/send_audio.py @@ -48,6 +48,7 @@ class SendAudio: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -121,6 +122,10 @@ class SendAudio: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -181,7 +186,7 @@ class SendAudio: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_cached_media.py b/pyrogram/methods/messages/send_cached_media.py index a4208f29..0e155172 100644 --- a/pyrogram/methods/messages/send_cached_media.py +++ b/pyrogram/methods/messages/send_cached_media.py @@ -39,6 +39,7 @@ class SendCachedMedia: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -93,6 +94,10 @@ class SendCachedMedia: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -114,7 +119,7 @@ class SendCachedMedia: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_contact.py b/pyrogram/methods/messages/send_contact.py index 83263f17..f5d38e10 100644 --- a/pyrogram/methods/messages/send_contact.py +++ b/pyrogram/methods/messages/send_contact.py @@ -36,6 +36,7 @@ class SendContact: disable_notification: bool = None, message_thread_id: int = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -78,6 +79,10 @@ class SendContact: reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -99,7 +104,7 @@ class SendContact: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) r = await self.invoke( raw.functions.messages.SendMedia( diff --git a/pyrogram/methods/messages/send_dice.py b/pyrogram/methods/messages/send_dice.py index ecd504b9..7384bdbb 100644 --- a/pyrogram/methods/messages/send_dice.py +++ b/pyrogram/methods/messages/send_dice.py @@ -34,6 +34,7 @@ class SendDice: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -74,6 +75,10 @@ class SendDice: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -102,7 +107,7 @@ class SendDice: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_document.py b/pyrogram/methods/messages/send_document.py index 7f4df28d..64d21f4d 100644 --- a/pyrogram/methods/messages/send_document.py +++ b/pyrogram/methods/messages/send_document.py @@ -46,6 +46,7 @@ class SendDocument: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -113,6 +114,10 @@ class SendDocument: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -168,7 +173,7 @@ class SendDocument: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_location.py b/pyrogram/methods/messages/send_location.py index 972cd869..d9782427 100644 --- a/pyrogram/methods/messages/send_location.py +++ b/pyrogram/methods/messages/send_location.py @@ -34,6 +34,7 @@ class SendLocation: disable_notification: bool = None, message_thread_id: int = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -70,6 +71,10 @@ class SendLocation: reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -91,7 +96,7 @@ class SendLocation: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) r = await self.invoke( raw.functions.messages.SendMedia( diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py index 75809a5a..1ff26028 100644 --- a/pyrogram/methods/messages/send_media_group.py +++ b/pyrogram/methods/messages/send_media_group.py @@ -49,6 +49,7 @@ class SendMediaGroup: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, ) -> List["types.Message"]: @@ -79,6 +80,10 @@ class SendMediaGroup: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -106,7 +111,7 @@ class SendMediaGroup: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_message.py b/pyrogram/methods/messages/send_message.py index 9f3f4d0b..5dd071bc 100644 --- a/pyrogram/methods/messages/send_message.py +++ b/pyrogram/methods/messages/send_message.py @@ -37,6 +37,7 @@ class SendMessage: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -83,6 +84,10 @@ class SendMessage: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -135,7 +140,7 @@ class SendMessage: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py index f04831e3..343aad4d 100644 --- a/pyrogram/methods/messages/send_photo.py +++ b/pyrogram/methods/messages/send_photo.py @@ -44,6 +44,7 @@ class SendPhoto: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -104,6 +105,10 @@ class SendPhoto: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -159,7 +164,7 @@ class SendPhoto: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_poll.py b/pyrogram/methods/messages/send_poll.py index d58c0c69..75f70f05 100644 --- a/pyrogram/methods/messages/send_poll.py +++ b/pyrogram/methods/messages/send_poll.py @@ -45,6 +45,7 @@ class SendPoll: protect_content: bool = None, message_thread_id: int = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -123,6 +124,10 @@ class SendPoll: reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -141,7 +146,7 @@ class SendPoll: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) solution, solution_entities = (await utils.parse_text_entities( self, explanation, explanation_parse_mode, explanation_entities diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py index 3b6e7f53..428c4ad7 100644 --- a/pyrogram/methods/messages/send_sticker.py +++ b/pyrogram/methods/messages/send_sticker.py @@ -40,6 +40,7 @@ class SendSticker: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -82,6 +83,10 @@ class SendSticker: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -132,7 +137,7 @@ class SendSticker: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_venue.py b/pyrogram/methods/messages/send_venue.py index 4013796f..1d90c8a9 100644 --- a/pyrogram/methods/messages/send_venue.py +++ b/pyrogram/methods/messages/send_venue.py @@ -38,6 +38,7 @@ class SendVenue: disable_notification: bool = None, message_thread_id: int = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -87,6 +88,10 @@ class SendVenue: reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -110,7 +115,7 @@ class SendVenue: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) r = await self.invoke( raw.functions.messages.SendMedia( diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py index ef8585c7..b144bd82 100644 --- a/pyrogram/methods/messages/send_video.py +++ b/pyrogram/methods/messages/send_video.py @@ -51,6 +51,7 @@ class SendVideo: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -134,6 +135,10 @@ class SendVideo: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -192,7 +197,7 @@ class SendVideo: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py index a1285a6d..8106aff6 100644 --- a/pyrogram/methods/messages/send_video_note.py +++ b/pyrogram/methods/messages/send_video_note.py @@ -42,6 +42,7 @@ class SendVideoNote: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -96,6 +97,10 @@ class SendVideoNote: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -146,7 +151,7 @@ class SendVideoNote: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py index b07f4c59..2226bb4f 100644 --- a/pyrogram/methods/messages/send_voice.py +++ b/pyrogram/methods/messages/send_voice.py @@ -44,6 +44,7 @@ class SendVoice: message_thread_id: int = None, reply_to_message_id: int = None, reply_to_story_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup: Union[ @@ -102,6 +103,10 @@ class SendVoice: reply_to_story_id (``int``, *optional*): Unique identifier for the target story. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -154,7 +159,7 @@ class SendVoice: reply_to = None if reply_to_message_id or message_thread_id: - reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id) + reply_to = types.InputReplyToMessage(reply_to_message_id=reply_to_message_id, message_thread_id=message_thread_id, quote_text=quote_text) if reply_to_story_id: user_id = await self.resolve_peer(chat_id) reply_to = types.InputReplyToStory(user_id=user_id, story_id=reply_to_story_id) diff --git a/pyrogram/types/input_message_content/input_reply_to_message.py b/pyrogram/types/input_message_content/input_reply_to_message.py index c86d6e1d..6b27034a 100644 --- a/pyrogram/types/input_message_content/input_reply_to_message.py +++ b/pyrogram/types/input_message_content/input_reply_to_message.py @@ -36,12 +36,14 @@ class InputReplyToMessage(Object): def __init__( self, *, reply_to_message_id: int = None, - message_thread_id: int = None + message_thread_id: int = None, + quote_text: str = None ): super().__init__() self.reply_to_message_id = reply_to_message_id self.message_thread_id = message_thread_id + self.quote_text = quote_text def write(self): reply_to_msg_id = None @@ -57,6 +59,7 @@ class InputReplyToMessage(Object): reply_to_msg_id = self.reply_to_message_id return raw.types.InputReplyToMessage( reply_to_msg_id=reply_to_msg_id, - top_msg_id=top_msg_id + top_msg_id=top_msg_id, + quote_text=self.quote_text ).write() return None diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 2b7867b6..5c3ce4d8 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -1087,6 +1087,7 @@ class Message(Object, Update): disable_web_page_preview: bool = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, protect_content: bool = None, reply_markup=None @@ -1136,6 +1137,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -1171,6 +1176,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, schedule_date=schedule_date, protect_content=protect_content, reply_markup=reply_markup @@ -1199,6 +1205,7 @@ class Message(Object, Update): "types.ForceReply" ] = None, reply_to_message_id: int = None, + quote_text: str = None, progress: Callable = None, progress_args: tuple = () ) -> "Message": @@ -1269,6 +1276,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -1328,6 +1339,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -1347,6 +1359,7 @@ class Message(Object, Update): file_name: str = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -1420,6 +1433,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -1478,6 +1495,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -1492,6 +1510,7 @@ class Message(Object, Update): caption_entities: List["types.MessageEntity"] = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -1542,6 +1561,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -1571,6 +1594,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup ) @@ -1620,6 +1644,7 @@ class Message(Object, Update): vcard: str = "", disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -1669,6 +1694,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -1698,6 +1727,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup ) @@ -1713,6 +1743,7 @@ class Message(Object, Update): force_document: bool = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -1782,6 +1813,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -1842,6 +1877,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, schedule_date=schedule_date, reply_markup=reply_markup, progress=progress, @@ -1928,7 +1964,8 @@ class Message(Object, Update): result_id: str, quote: bool = None, disable_notification: bool = None, - reply_to_message_id: int = None + reply_to_message_id: int = None, + quote_text: str = None ) -> "Message": """Bound method *reply_inline_bot_result* of :obj:`~pyrogram.types.Message`. @@ -1966,6 +2003,10 @@ class Message(Object, Update): reply_to_message_id (``bool``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + Returns: On success, the sent Message is returned. @@ -1988,7 +2029,8 @@ class Message(Object, Update): result_id=result_id, disable_notification=disable_notification, message_thread_id=message_thread_id, - reply_to_message_id=reply_to_message_id + reply_to_message_id=reply_to_message_id, + quote_text=quote_text ) async def reply_location( @@ -1998,6 +2040,7 @@ class Message(Object, Update): quote: bool = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2041,6 +2084,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2068,6 +2115,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup ) @@ -2081,7 +2129,8 @@ class Message(Object, Update): ]], quote: bool = None, disable_notification: bool = None, - reply_to_message_id: int = None + reply_to_message_id: int = None, + quote_text: str = None ) -> List["types.Message"]: """Bound method *reply_media_group* of :obj:`~pyrogram.types.Message`. @@ -2117,6 +2166,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + Returns: On success, a :obj:`~pyrogram.types.Messages` object is returned containing all the single messages sent. @@ -2139,7 +2192,8 @@ class Message(Object, Update): media=media, disable_notification=disable_notification, message_thread_id=message_thread_id, - reply_to_message_id=reply_to_message_id + reply_to_message_id=reply_to_message_id, + quote_text=quote_text ) async def reply_photo( @@ -2153,6 +2207,7 @@ class Message(Object, Update): ttl_seconds: int = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2215,6 +2270,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2270,6 +2329,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -2293,6 +2353,7 @@ class Message(Object, Update): disable_notification: bool = None, protect_content: bool = None, reply_to_message_id: int = None, + quote_text: str = None, schedule_date: datetime = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -2380,6 +2441,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. @@ -2421,6 +2486,7 @@ class Message(Object, Update): protect_content=protect_content, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, schedule_date=schedule_date, reply_markup=reply_markup ) @@ -2431,6 +2497,7 @@ class Message(Object, Update): quote: bool = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2475,6 +2542,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2525,6 +2596,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -2541,6 +2613,7 @@ class Message(Object, Update): foursquare_type: str = "", disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2599,6 +2672,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2630,6 +2707,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup ) @@ -2650,6 +2728,7 @@ class Message(Object, Update): supports_streaming: bool = True, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2734,6 +2813,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message. + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2795,6 +2878,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -2809,6 +2893,7 @@ class Message(Object, Update): thumb: Union[str, BinaryIO] = None, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2865,6 +2950,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -2918,6 +3007,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args @@ -2933,6 +3023,7 @@ class Message(Object, Update): duration: int = 0, disable_notification: bool = None, reply_to_message_id: int = None, + quote_text: str = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2990,6 +3081,10 @@ class Message(Object, Update): reply_to_message_id (``int``, *optional*): If the message is a reply, ID of the original message + quote_text (``str``, *optional*): + Text to quote. + for reply_to_message only. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.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. @@ -3044,6 +3139,7 @@ class Message(Object, Update): disable_notification=disable_notification, message_thread_id=message_thread_id, reply_to_message_id=reply_to_message_id, + quote_text=quote_text, reply_markup=reply_markup, progress=progress, progress_args=progress_args