Added new invert_media field to methods

This commit is contained in:
KurimuzonAkuma 2023-10-29 10:48:54 +03:00
parent cdc1fd9d12
commit d342f762e4
4 changed files with 22 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class CopyMediaGroup:
message_thread_id: int = None, message_thread_id: int = None,
reply_to_message_id: int = None, reply_to_message_id: int = None,
schedule_date: datetime = None, schedule_date: datetime = None,
invert_media: bool = None,
) -> List["types.Message"]: ) -> List["types.Message"]:
"""Copy a media group by providing one of the message ids. """Copy a media group by providing one of the message ids.
@ -76,6 +77,9 @@ class CopyMediaGroup:
schedule_date (:py:obj:`~datetime.datetime`, *optional*): schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent. Date when the message will be automatically sent.
invert_media (``bool``, *optional*):
Invert media.
Returns: Returns:
List of :obj:`~pyrogram.types.Message`: On success, a list of copied messages is returned. List of :obj:`~pyrogram.types.Message`: On success, a list of copied messages is returned.
@ -125,7 +129,8 @@ class CopyMediaGroup:
multi_media=multi_media, multi_media=multi_media,
silent=disable_notification or None, silent=disable_notification or None,
reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id), reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id),
schedule_date=utils.datetime_to_timestamp(schedule_date) schedule_date=utils.datetime_to_timestamp(schedule_date),
invert_media=invert_media
), ),
sleep_threshold=60 sleep_threshold=60
) )

View File

@ -34,6 +34,7 @@ class EditMessageMedia:
chat_id: Union[int, str], chat_id: Union[int, str],
message_id: int, message_id: int,
media: "types.InputMedia", media: "types.InputMedia",
invert_media: bool = None,
reply_markup: "types.InlineKeyboardMarkup" = None, reply_markup: "types.InlineKeyboardMarkup" = None,
file_name: str = None file_name: str = None
) -> "types.Message": ) -> "types.Message":
@ -56,6 +57,9 @@ class EditMessageMedia:
media (:obj:`~pyrogram.types.InputMedia`): media (:obj:`~pyrogram.types.InputMedia`):
One of the InputMedia objects describing an animation, audio, document, photo or video. One of the InputMedia objects describing an animation, audio, document, photo or video.
invert_media (``bool``, *optional*):
Invert media.
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*): reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
An InlineKeyboardMarkup object. An InlineKeyboardMarkup object.
@ -271,6 +275,7 @@ class EditMessageMedia:
raw.functions.messages.EditMessage( raw.functions.messages.EditMessage(
peer=await self.resolve_peer(chat_id), peer=await self.resolve_peer(chat_id),
id=message_id, id=message_id,
invert_media=invert_media,
media=media, media=media,
reply_markup=await reply_markup.write(self) if reply_markup else None, reply_markup=await reply_markup.write(self) if reply_markup else None,
message=message, message=message,

View File

@ -39,6 +39,7 @@ class SendCachedMedia:
reply_to_story_id: int = None, reply_to_story_id: int = None,
schedule_date: datetime = None, schedule_date: datetime = None,
protect_content: bool = None, protect_content: bool = None,
invert_media: bool = None,
reply_markup: Union[ reply_markup: Union[
"types.InlineKeyboardMarkup", "types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup", "types.ReplyKeyboardMarkup",
@ -94,6 +95,9 @@ class SendCachedMedia:
protect_content (``bool``, *optional*): protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving. Protects the contents of the sent message from forwarding and saving.
invert_media (``bool``, *optional*):
Invert media.
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): 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, 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. instructions to remove reply keyboard or to force a reply from the user.
@ -112,6 +116,7 @@ class SendCachedMedia:
peer=peer, peer=peer,
media=utils.get_input_media_from_file_id(file_id), media=utils.get_input_media_from_file_id(file_id),
silent=disable_notification or None, silent=disable_notification or None,
invert_media=invert_media,
reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id, peer, reply_to_story_id), reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id, peer, reply_to_story_id),
random_id=self.rnd_id(), random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date), schedule_date=utils.datetime_to_timestamp(schedule_date),

View File

@ -48,6 +48,7 @@ class SendMediaGroup:
reply_to_story_id: int = None, reply_to_story_id: int = None,
schedule_date: datetime = None, schedule_date: datetime = None,
protect_content: bool = None, protect_content: bool = None,
invert_media: bool = None,
) -> List["types.Message"]: ) -> List["types.Message"]:
"""Send a group of photos or videos as an album. """Send a group of photos or videos as an album.
@ -82,6 +83,9 @@ class SendMediaGroup:
protect_content (``bool``, *optional*): protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving. Protects the contents of the sent message from forwarding and saving.
invert_media (``bool``, *optional*):
Invert media.
Returns: Returns:
List of :obj:`~pyrogram.types.Message`: On success, a list of the sent messages is returned. List of :obj:`~pyrogram.types.Message`: On success, a list of the sent messages is returned.
@ -407,7 +411,8 @@ class SendMediaGroup:
silent=disable_notification or None, silent=disable_notification or None,
reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id, peer, reply_to_story_id), reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id, peer, reply_to_story_id),
schedule_date=utils.datetime_to_timestamp(schedule_date), schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content noforwards=protect_content,
invert_media=invert_media
), ),
sleep_threshold=60 sleep_threshold=60
) )