Skip to content

Commit a116ea4

Browse files
committed
Add the field has_spoiler to relevant InputMedia* classes
- InputMediaPhoto - InputMediaVideo - InputMediaAnimation
1 parent 06996d2 commit a116ea4

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

pyrogram/types/input_media/input_media_animation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class InputMediaAnimation(InputMedia):
5959
6060
duration (``int``, *optional*):
6161
Animation duration.
62+
63+
has_spoiler (``bool``, *optional*):
64+
Pass True if the photo needs to be covered with a spoiler animation.
6265
"""
6366

6467
def __init__(
@@ -70,11 +73,13 @@ def __init__(
7073
caption_entities: List[MessageEntity] = None,
7174
width: int = 0,
7275
height: int = 0,
73-
duration: int = 0
76+
duration: int = 0,
77+
has_spoiler: bool = None
7478
):
7579
super().__init__(media, caption, parse_mode, caption_entities)
7680

7781
self.thumb = thumb
7882
self.width = width
7983
self.height = height
8084
self.duration = duration
85+
self.has_spoiler = has_spoiler

pyrogram/types/input_media/input_media_photo.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ class InputMediaPhoto(InputMedia):
4545
4646
caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
4747
List of special entities that appear in the caption, which can be specified instead of *parse_mode*.
48+
49+
has_spoiler (``bool``, *optional*):
50+
Pass True if the photo needs to be covered with a spoiler animation.
4851
"""
4952

5053
def __init__(
5154
self,
5255
media: Union[str, BinaryIO],
5356
caption: str = "",
5457
parse_mode: Optional["enums.ParseMode"] = None,
55-
caption_entities: List[MessageEntity] = None
58+
caption_entities: List[MessageEntity] = None,
59+
has_spoiler: bool = None
5660
):
5761
super().__init__(media, caption, parse_mode, caption_entities)
62+
63+
self.has_spoiler = has_spoiler

pyrogram/types/input_media/input_media_video.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class InputMediaVideo(InputMedia):
6363
6464
supports_streaming (``bool``, *optional*):
6565
Pass True, if the uploaded video is suitable for streaming.
66+
67+
has_spoiler (``bool``, *optional*):
68+
Pass True if the photo needs to be covered with a spoiler animation.
6669
"""
6770

6871
def __init__(
@@ -75,7 +78,8 @@ def __init__(
7578
width: int = 0,
7679
height: int = 0,
7780
duration: int = 0,
78-
supports_streaming: bool = True
81+
supports_streaming: bool = True,
82+
has_spoiler: bool = None,
7983
):
8084
super().__init__(media, caption, parse_mode, caption_entities)
8185

@@ -84,3 +88,4 @@ def __init__(
8488
self.height = height
8589
self.duration = duration
8690
self.supports_streaming = supports_streaming
91+
self.has_spoiler = has_spoiler

0 commit comments

Comments
 (0)