mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Pyrofork: Add is_safe field to WebPagePreview
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
437a141f88
commit
038462a232
2 changed files with 9 additions and 3 deletions
|
|
@ -4164,7 +4164,7 @@ class Message(Object, Update):
|
||||||
message_thread_id=message_thread_id,
|
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,
|
quote_text=quote_text,
|
||||||
quote_entities=quote_entities,
|
quote_entities=quote_entities,
|
||||||
schedule_date=schedule_date,
|
schedule_date=schedule_date,
|
||||||
protect_content=protect_content,
|
protect_content=protect_content,
|
||||||
reply_markup=self.reply_markup if reply_markup is object else reply_markup
|
reply_markup=self.reply_markup if reply_markup is object else reply_markup
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ class WebPagePreview(Object):
|
||||||
|
|
||||||
force_small_media (``bool``, *optional*):
|
force_small_media (``bool``, *optional*):
|
||||||
True, If the preview media size is forced to small.
|
True, If the preview media size is forced to small.
|
||||||
|
|
||||||
|
is_safe (``bool``, *optional*):
|
||||||
|
True, If the webpage is considered safe by telegram.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
@ -43,7 +46,8 @@ class WebPagePreview(Object):
|
||||||
webpage: Union["types.WebPage", "types.WebPageEmpty"],
|
webpage: Union["types.WebPage", "types.WebPageEmpty"],
|
||||||
force_large_media: bool = None,
|
force_large_media: bool = None,
|
||||||
force_small_media: bool = None,
|
force_small_media: bool = None,
|
||||||
invert_media: bool = None
|
invert_media: bool = None,
|
||||||
|
is_safe: bool = None
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
|
@ -51,6 +55,7 @@ class WebPagePreview(Object):
|
||||||
self.force_large_media = force_large_media
|
self.force_large_media = force_large_media
|
||||||
self.force_small_media = force_small_media
|
self.force_small_media = force_small_media
|
||||||
self.invert_media = invert_media
|
self.invert_media = invert_media
|
||||||
|
self.is_safe = is_safe
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(
|
def _parse(
|
||||||
|
|
@ -66,5 +71,6 @@ class WebPagePreview(Object):
|
||||||
webpage=webpage,
|
webpage=webpage,
|
||||||
force_large_media=web_page_preview.force_large_media,
|
force_large_media=web_page_preview.force_large_media,
|
||||||
force_small_media=web_page_preview.force_small_media,
|
force_small_media=web_page_preview.force_small_media,
|
||||||
invert_media=invert_media
|
invert_media=invert_media,
|
||||||
|
is_safe=web_page_preview.safe
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue