Add show_above_text to Message.edit bound method

This commit is contained in:
KurimuzonAkuma 2024-03-01 17:15:39 +03:00
parent 210b054544
commit 2ccdf23e6e
2 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class EditMessageText:
parse_mode: Optional["enums.ParseMode"] = None,
entities: List["types.MessageEntity"] = None,
disable_web_page_preview: bool = None,
show_above_text: bool = None,
schedule_date: datetime = None,
reply_markup: "types.InlineKeyboardMarkup" = None
) -> "types.Message":
@ -63,6 +64,10 @@ class EditMessageText:
disable_web_page_preview (``bool``, *optional*):
Disables link previews for links in this message.
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.
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
@ -89,6 +94,7 @@ class EditMessageText:
peer=await self.resolve_peer(chat_id),
id=message_id,
no_webpage=disable_web_page_preview or None,
invert_media=show_above_text or None,
schedule_date=utils.datetime_to_timestamp(schedule_date),
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, text, parse_mode, entities)

View File

@ -3574,6 +3574,7 @@ class Message(Object, Update):
parse_mode: Optional["enums.ParseMode"] = None,
entities: List["types.MessageEntity"] = None,
disable_web_page_preview: bool = None,
show_above_text: bool = None,
reply_markup: "types.InlineKeyboardMarkup" = None
) -> "Message":
"""Bound method *edit_text* of :obj:`~pyrogram.types.Message`.
@ -3609,6 +3610,10 @@ class Message(Object, Update):
disable_web_page_preview (``bool``, *optional*):
Disables link previews for links in this message.
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.
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
An InlineKeyboardMarkup object.
@ -3625,6 +3630,7 @@ class Message(Object, Update):
parse_mode=parse_mode,
entities=entities,
disable_web_page_preview=disable_web_page_preview,
show_above_text=show_above_text,
reply_markup=reply_markup
)