mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +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
|
|
@ -35,6 +35,9 @@ class WebPagePreview(Object):
|
|||
|
||||
force_small_media (``bool``, *optional*):
|
||||
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__(
|
||||
|
|
@ -43,7 +46,8 @@ class WebPagePreview(Object):
|
|||
webpage: Union["types.WebPage", "types.WebPageEmpty"],
|
||||
force_large_media: bool = None,
|
||||
force_small_media: bool = None,
|
||||
invert_media: bool = None
|
||||
invert_media: bool = None,
|
||||
is_safe: bool = None
|
||||
):
|
||||
super().__init__()
|
||||
|
||||
|
|
@ -51,6 +55,7 @@ class WebPagePreview(Object):
|
|||
self.force_large_media = force_large_media
|
||||
self.force_small_media = force_small_media
|
||||
self.invert_media = invert_media
|
||||
self.is_safe = is_safe
|
||||
|
||||
@staticmethod
|
||||
def _parse(
|
||||
|
|
@ -66,5 +71,6 @@ class WebPagePreview(Object):
|
|||
webpage=webpage,
|
||||
force_large_media=web_page_preview.force_large_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