diff --git a/pyrogram/methods/messages/copy_message.py b/pyrogram/methods/messages/copy_message.py index 8629d095..1a7ccd50 100644 --- a/pyrogram/methods/messages/copy_message.py +++ b/pyrogram/methods/messages/copy_message.py @@ -42,6 +42,7 @@ class CopyMessage: reply_to_message_id: int = None, schedule_date: datetime = None, protect_content: bool = None, + invert_media: bool = False, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -104,6 +105,9 @@ class CopyMessage: protect_content (``bool``, *optional*): Protects the contents of the sent message from forwarding and saving. + invert_media (``bool``, *optional*): + Inverts the position of the media and caption. + 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. @@ -131,5 +135,6 @@ class CopyMessage: reply_to_message_id=reply_to_message_id, schedule_date=schedule_date, protect_content=protect_content, + invert_media=invert_media, reply_markup=reply_markup ) diff --git a/pyrogram/methods/messages/edit_message_caption.py b/pyrogram/methods/messages/edit_message_caption.py index c7b7a786..a902b03a 100644 --- a/pyrogram/methods/messages/edit_message_caption.py +++ b/pyrogram/methods/messages/edit_message_caption.py @@ -31,6 +31,7 @@ class EditMessageCaption: caption: str, parse_mode: Optional["enums.ParseMode"] = None, caption_entities: List["types.MessageEntity"] = None, + invert_media: bool = False, reply_markup: "types.InlineKeyboardMarkup" = None ) -> "types.Message": """Edit the caption of media messages. @@ -57,6 +58,9 @@ class EditMessageCaption: caption_entities (List of :obj:`~pyrogram.types.MessageEntity`): List of special entities that appear in the caption, which can be specified instead of *parse_mode*. + invert_media (``bool``, *optional*): + Inverts the position of the media and caption. + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*): An InlineKeyboardMarkup object. @@ -74,5 +78,6 @@ class EditMessageCaption: text=caption, parse_mode=parse_mode, entities=caption_entities, + invert_media=invert_media, reply_markup=reply_markup ) diff --git a/pyrogram/methods/messages/edit_message_media.py b/pyrogram/methods/messages/edit_message_media.py index de5af3ad..e15218e4 100644 --- a/pyrogram/methods/messages/edit_message_media.py +++ b/pyrogram/methods/messages/edit_message_media.py @@ -36,7 +36,8 @@ class EditMessageMedia: message_id: int, media: "types.InputMedia", reply_markup: "types.InlineKeyboardMarkup" = None, - file_name: str = None + file_name: str = None, + invert_media: bool = False ) -> "types.Message": """Edit animation, audio, document, photo or video messages. @@ -65,6 +66,9 @@ class EditMessageMedia: File name of the media to be sent. Not applicable to photos. Defaults to file's path basename. + invert_media (``bool``, *optional*): + Inverts the position of the media and caption. + Returns: :obj:`~pyrogram.types.Message`: On success, the edited message is returned. @@ -276,7 +280,8 @@ class EditMessageMedia: media=media, reply_markup=await reply_markup.write(self) if reply_markup else None, message=message, - entities=entities + entities=entities, + invert_media=invert_media ) ) diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index e70fb19a..cb4e2dbf 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -57,6 +57,7 @@ class SendAnimation: schedule_date: datetime = None, protect_content: bool = None, message_effect_id: int = None, + invert_media: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -160,6 +161,9 @@ class SendAnimation: protect_content (``bool``, *optional*): Protects the contents of the sent message from forwarding and saving. + invert_media (``bool``, *optional*): + Inverts the position of the animation and caption. + 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. @@ -283,6 +287,7 @@ class SendAnimation: schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, effect=message_effect_id, + invert_media=invert_media, reply_markup=await reply_markup.write(self) if reply_markup else None, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) ) diff --git a/pyrogram/methods/messages/send_cached_media.py b/pyrogram/methods/messages/send_cached_media.py index 9361ed32..a2c57370 100644 --- a/pyrogram/methods/messages/send_cached_media.py +++ b/pyrogram/methods/messages/send_cached_media.py @@ -44,6 +44,7 @@ class SendCachedMedia: quote_entities: List["types.MessageEntity"] = None, schedule_date: datetime = None, protect_content: bool = None, + invert_media: bool = False, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -116,6 +117,9 @@ class SendCachedMedia: protect_content (``bool``, *optional*): Protects the contents of the sent message from forwarding and saving. + invert_media (``bool``, *optional*): + Inverts the position of the media and caption. + 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. @@ -156,6 +160,7 @@ class SendCachedMedia: random_id=self.rnd_id(), schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + invert_media=invert_media, reply_markup=await reply_markup.write(self) if reply_markup else None, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) ) diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py index 83927d4a..bb49ef4f 100644 --- a/pyrogram/methods/messages/send_media_group.py +++ b/pyrogram/methods/messages/send_media_group.py @@ -57,7 +57,8 @@ class SendMediaGroup: parse_mode: Optional["enums.ParseMode"] = None, schedule_date: datetime = None, protect_content: bool = None, - message_effect_id: int = None + message_effect_id: int = None, + invert_media: bool = None ) -> List["types.Message"]: """Send a group of photos or videos as an album. @@ -118,6 +119,9 @@ class SendMediaGroup: message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. + invert_media (``bool``, *optional*): + Inverts the position of the media and caption. + Returns: List of :obj:`~pyrogram.types.Message`: On success, a list of the sent messages is returned. @@ -470,7 +474,8 @@ class SendMediaGroup: reply_to=reply_to, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, - effect=message_effect_id + effect=message_effect_id, + invert_media=invert_media ) if business_connection_id is not None: diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py index 6c6296b3..284bfa0d 100644 --- a/pyrogram/methods/messages/send_photo.py +++ b/pyrogram/methods/messages/send_photo.py @@ -52,6 +52,7 @@ class SendPhoto: protect_content: bool = None, message_effect_id: int = None, view_once: bool = None, + invert_media: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -141,6 +142,9 @@ class SendPhoto: Self-Destruct Timer. If True, the photo will self-destruct after it was viewed. + invert_media (``bool``, *optional*): + Inverts the position of the photo and caption. + 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. @@ -237,6 +241,7 @@ class SendPhoto: schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, effect=message_effect_id, + invert_media=invert_media, reply_markup=await reply_markup.write(self) if reply_markup else None, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) ) diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py index f6b6319e..940b96af 100644 --- a/pyrogram/methods/messages/send_video.py +++ b/pyrogram/methods/messages/send_video.py @@ -58,6 +58,7 @@ class SendVideo: schedule_date: datetime = None, protect_content: bool = None, message_effect_id: int = None, + invert_media: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -166,6 +167,9 @@ class SendVideo: message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. + invert_media (``bool``, *optional*): + Inverts the position of the video and caption. + 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. @@ -289,6 +293,7 @@ class SendVideo: schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, effect=message_effect_id, + invert_media=invert_media, reply_markup=await reply_markup.write(self) if reply_markup else None, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) )