mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
parent
17123664f1
commit
f1246640c1
@ -40,7 +40,7 @@ class CopyMediaGroup:
|
||||
quote_entities: List["types.MessageEntity"] = None,
|
||||
quote_offset: int = None,
|
||||
schedule_date: datetime = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
) -> List["types.Message"]:
|
||||
"""Copy a media group by providing one of the message ids.
|
||||
|
||||
@ -102,7 +102,7 @@ class CopyMediaGroup:
|
||||
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
|
||||
Date when the message will be automatically sent.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -165,7 +165,7 @@ class CopyMediaGroup:
|
||||
quote_offset=quote_offset,
|
||||
),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
invert_media=invert_media
|
||||
invert_media=show_above_text
|
||||
),
|
||||
sleep_threshold=60
|
||||
)
|
||||
|
@ -35,7 +35,7 @@ class EditMessageMedia:
|
||||
chat_id: Union[int, str],
|
||||
message_id: int,
|
||||
media: "types.InputMedia",
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
schedule_date: datetime = None,
|
||||
reply_markup: "types.InlineKeyboardMarkup" = None,
|
||||
file_name: str = None
|
||||
@ -59,7 +59,7 @@ class EditMessageMedia:
|
||||
media (:obj:`~pyrogram.types.InputMedia`):
|
||||
One of the InputMedia objects describing an animation, audio, document, photo or video.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -281,7 +281,7 @@ class EditMessageMedia:
|
||||
raw.functions.messages.EditMessage(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
id=message_id,
|
||||
invert_media=invert_media,
|
||||
invert_media=show_above_text,
|
||||
media=media,
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
reply_markup=await reply_markup.write(self) if reply_markup else None,
|
||||
|
@ -43,7 +43,7 @@ class SendCachedMedia:
|
||||
schedule_date: datetime = None,
|
||||
protect_content: bool = None,
|
||||
has_spoiler: bool = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
reply_markup: Union[
|
||||
"types.InlineKeyboardMarkup",
|
||||
"types.ReplyKeyboardMarkup",
|
||||
@ -111,7 +111,7 @@ class SendCachedMedia:
|
||||
has_spoiler (``bool``, *optional*):
|
||||
True, if the message media is covered by a spoiler animation.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -135,7 +135,7 @@ class SendCachedMedia:
|
||||
peer=peer,
|
||||
media=utils.get_input_media_from_file_id(file_id, has_spoiler=has_spoiler),
|
||||
silent=disable_notification or None,
|
||||
invert_media=invert_media,
|
||||
invert_media=show_above_text,
|
||||
reply_to=utils.get_reply_to(
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
message_thread_id=message_thread_id,
|
||||
|
@ -54,7 +54,7 @@ class SendMediaGroup:
|
||||
quote_offset: int = None,
|
||||
schedule_date: datetime = None,
|
||||
protect_content: bool = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
) -> List["types.Message"]:
|
||||
"""Send a group of photos or videos as an album.
|
||||
|
||||
@ -105,7 +105,7 @@ class SendMediaGroup:
|
||||
protect_content (``bool``, *optional*):
|
||||
Protects the contents of the sent message from forwarding and saving.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -445,7 +445,7 @@ class SendMediaGroup:
|
||||
),
|
||||
schedule_date=utils.datetime_to_timestamp(schedule_date),
|
||||
noforwards=protect_content,
|
||||
invert_media=invert_media
|
||||
invert_media=show_above_text
|
||||
),
|
||||
sleep_threshold=60
|
||||
)
|
||||
|
@ -34,7 +34,7 @@ class SendMessage:
|
||||
disable_web_page_preview: bool = None,
|
||||
disable_notification: bool = None,
|
||||
message_thread_id: int = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_to_chat_id: Union[int, str] = None,
|
||||
reply_to_story_id: int = None,
|
||||
@ -81,7 +81,7 @@ class SendMessage:
|
||||
Unique identifier for the target message thread (topic) of the forum.
|
||||
For supergroups only.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -161,7 +161,7 @@ class SendMessage:
|
||||
peer=peer,
|
||||
no_webpage=disable_web_page_preview or None,
|
||||
silent=disable_notification or None,
|
||||
invert_media=invert_media or None,
|
||||
invert_media=show_above_text or None,
|
||||
reply_to=utils.get_reply_to(
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
message_thread_id=message_thread_id,
|
||||
|
@ -29,13 +29,13 @@ class SendWebPage:
|
||||
chat_id: Union[int, str],
|
||||
text: str = None,
|
||||
url: str = None,
|
||||
force_large_media: bool = None,
|
||||
force_small_media: bool = None,
|
||||
prefer_large_media: bool = None,
|
||||
prefer_small_media: bool = None,
|
||||
parse_mode: Optional["enums.ParseMode"] = None,
|
||||
entities: List["types.MessageEntity"] = None,
|
||||
disable_notification: bool = None,
|
||||
message_thread_id: int = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_to_chat_id: Union[int, str] = None,
|
||||
reply_to_story_id: int = None,
|
||||
@ -75,15 +75,15 @@ class SendWebPage:
|
||||
entities (List of :obj:`~pyrogram.types.MessageEntity`):
|
||||
List of special entities that appear in message text, which can be specified instead of *parse_mode*.
|
||||
|
||||
force_large_media (``bool``, *optional*):
|
||||
prefer_large_media (``bool``, *optional*):
|
||||
If True, media in the link preview will be larger.
|
||||
Ignored if the URL isn't explicitly specified or media size change isn't supported for the preview.
|
||||
|
||||
force_small_media (``bool``, *optional*):
|
||||
prefer_small_media (``bool``, *optional*):
|
||||
If True, media in the link preview will be smaller.
|
||||
Ignored if the URL isn't explicitly specified or media size change isn't supported for the preview.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -133,7 +133,7 @@ class SendWebPage:
|
||||
await app.send_web_page("me", "https://docs.pyrogram.org")
|
||||
|
||||
# Make web preview image larger
|
||||
await app.send_web_page("me", "https://docs.pyrogram.org", force_large_media=True)
|
||||
await app.send_web_page("me", "https://docs.pyrogram.org", prefer_large_media=True)
|
||||
|
||||
"""
|
||||
|
||||
@ -173,10 +173,10 @@ class SendWebPage:
|
||||
message=message,
|
||||
media=raw.types.InputMediaWebPage(
|
||||
url=url,
|
||||
force_large_media=force_large_media,
|
||||
force_small_media=force_small_media
|
||||
force_large_media=prefer_large_media,
|
||||
force_small_media=prefer_small_media
|
||||
),
|
||||
invert_media=invert_media,
|
||||
invert_media=show_above_text,
|
||||
entities=entities,
|
||||
noforwards=protect_content
|
||||
)
|
||||
|
@ -139,7 +139,7 @@ class Message(Object, Update):
|
||||
This field will contain the enumeration type of the media message.
|
||||
You can use ``media = getattr(message, message.media.value)`` to access the media message.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -402,7 +402,7 @@ class Message(Object, Update):
|
||||
scheduled: bool = None,
|
||||
from_scheduled: bool = None,
|
||||
media: "enums.MessageMediaType" = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
edit_date: datetime = None,
|
||||
edit_hidden: bool = None,
|
||||
media_group_id: int = None,
|
||||
@ -501,7 +501,7 @@ class Message(Object, Update):
|
||||
self.scheduled = scheduled
|
||||
self.from_scheduled = from_scheduled
|
||||
self.media = media
|
||||
self.invert_media = invert_media
|
||||
self.show_above_text = show_above_text
|
||||
self.edit_date = edit_date
|
||||
self.edit_hidden = edit_hidden
|
||||
self.media_group_id = media_group_id
|
||||
@ -1018,7 +1018,7 @@ class Message(Object, Update):
|
||||
scheduled=is_scheduled,
|
||||
from_scheduled=message.from_scheduled,
|
||||
media=media_type,
|
||||
invert_media=getattr(message, "invert_media", None),
|
||||
show_above_text=getattr(message, "invert_media", None),
|
||||
edit_date=utils.timestamp_to_datetime(message.edit_date),
|
||||
edit_hidden=message.edit_hide,
|
||||
media_group_id=message.grouped_id,
|
||||
@ -1187,7 +1187,7 @@ class Message(Object, Update):
|
||||
disable_web_page_preview: bool = None,
|
||||
disable_notification: bool = None,
|
||||
message_thread_id: int = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
quote_text: str = None,
|
||||
quote_entities: List["types.MessageEntity"] = None,
|
||||
@ -1241,7 +1241,7 @@ class Message(Object, Update):
|
||||
Unique identifier of a message thread to which the message belongs.
|
||||
For supergroups only.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -1287,7 +1287,7 @@ class Message(Object, Update):
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
disable_notification=disable_notification,
|
||||
message_thread_id=message_thread_id,
|
||||
invert_media=invert_media,
|
||||
show_above_text=show_above_text,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
quote_text=quote_text,
|
||||
quote_entities=quote_entities,
|
||||
@ -3429,13 +3429,13 @@ class Message(Object, Update):
|
||||
self,
|
||||
text: str = None,
|
||||
url: str = None,
|
||||
force_large_media: bool = None,
|
||||
force_small_media: bool = None,
|
||||
prefer_large_media: bool = None,
|
||||
prefer_small_media: bool = None,
|
||||
parse_mode: Optional["enums.ParseMode"] = None,
|
||||
entities: List["types.MessageEntity"] = None,
|
||||
disable_notification: bool = None,
|
||||
message_thread_id: int = None,
|
||||
invert_media: bool = None,
|
||||
show_above_text: bool = None,
|
||||
reply_to_message_id: int = None,
|
||||
reply_to_chat_id: Union[int, str] = None,
|
||||
reply_to_story_id: int = None,
|
||||
@ -3482,15 +3482,15 @@ class Message(Object, Update):
|
||||
entities (List of :obj:`~pyrogram.types.MessageEntity`):
|
||||
List of special entities that appear in message text, which can be specified instead of *parse_mode*.
|
||||
|
||||
force_large_media (``bool``, *optional*):
|
||||
prefer_large_media (``bool``, *optional*):
|
||||
If True, media in the link preview will be larger.
|
||||
Ignored if the URL isn't explicitly specified or media size change isn't supported for the preview.
|
||||
|
||||
force_small_media (``bool``, *optional*):
|
||||
prefer_small_media (``bool``, *optional*):
|
||||
If True, media in the link preview will be smaller.
|
||||
Ignored if the URL isn't explicitly specified or media size change isn't supported for the preview.
|
||||
|
||||
invert_media (``bool``, *optional*):
|
||||
show_above_text (``bool``, *optional*):
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
@ -3537,13 +3537,13 @@ class Message(Object, Update):
|
||||
chat_id=self.chat.id,
|
||||
text=text,
|
||||
url=url,
|
||||
force_large_media=force_large_media,
|
||||
force_small_media=force_small_media,
|
||||
prefer_large_media=prefer_large_media,
|
||||
prefer_small_media=prefer_small_media,
|
||||
parse_mode=parse_mode,
|
||||
entities=entities,
|
||||
disable_notification=disable_notification,
|
||||
message_thread_id=message_thread_id,
|
||||
invert_media=invert_media,
|
||||
show_above_text=show_above_text,
|
||||
reply_to_message_id=reply_to_message_id,
|
||||
reply_to_chat_id=reply_to_chat_id,
|
||||
reply_to_story_id=reply_to_story_id,
|
||||
|
@ -80,11 +80,11 @@ class WebPage(Object):
|
||||
has_large_media (``bool``, *optional*):
|
||||
Whether the webpage preview is large.
|
||||
|
||||
force_large_media (``bool``, *optional*):
|
||||
Whether the webpage preview is forced large.
|
||||
prefer_large_media (``bool``, *optional*):
|
||||
Whether the webpage preview is large.
|
||||
|
||||
force_small_media (``bool``, *optional*):
|
||||
Whether the webpage preview is forced small.
|
||||
prefer_small_media (``bool``, *optional*):
|
||||
Whether the webpage preview is small.
|
||||
|
||||
manual (``bool``, *optional*):
|
||||
Whether the webpage preview was changed by the user.
|
||||
@ -120,8 +120,8 @@ class WebPage(Object):
|
||||
embed_width: int = None,
|
||||
embed_height: int = None,
|
||||
has_large_media: bool = None,
|
||||
force_large_media: bool = None,
|
||||
force_small_media: bool = None,
|
||||
prefer_large_media: bool = None,
|
||||
prefer_small_media: bool = None,
|
||||
manual: bool = None,
|
||||
safe: bool = None,
|
||||
duration: int = None,
|
||||
@ -146,8 +146,8 @@ class WebPage(Object):
|
||||
self.embed_width = embed_width
|
||||
self.embed_height = embed_height
|
||||
self.has_large_media = has_large_media
|
||||
self.force_large_media = force_large_media
|
||||
self.force_small_media = force_small_media
|
||||
self.prefer_large_media = prefer_large_media
|
||||
self.prefer_small_media = prefer_small_media
|
||||
self.manual = manual
|
||||
self.safe = safe
|
||||
self.duration = duration
|
||||
@ -157,8 +157,8 @@ class WebPage(Object):
|
||||
def _parse(
|
||||
client,
|
||||
webpage: "raw.types.WebPage",
|
||||
force_large_media: bool = None,
|
||||
force_small_media: bool = None,
|
||||
prefer_large_media: bool = None,
|
||||
prefer_small_media: bool = None,
|
||||
manual: bool = None,
|
||||
safe: bool = None
|
||||
) -> "WebPage":
|
||||
@ -215,8 +215,8 @@ class WebPage(Object):
|
||||
embed_width=webpage.embed_width,
|
||||
embed_height=webpage.embed_height,
|
||||
has_large_media=webpage.has_large_media,
|
||||
force_large_media=force_large_media,
|
||||
force_small_media=force_small_media,
|
||||
prefer_large_media=prefer_large_media,
|
||||
prefer_small_media=prefer_small_media,
|
||||
manual=manual,
|
||||
safe=safe,
|
||||
duration=webpage.duration,
|
||||
|
Loading…
Reference in New Issue
Block a user