Skip to content

Commit 8c2dd9d

Browse files
committed
Fix ttl_seconds and thumbs not being optional
1 parent 5b042a6 commit 8c2dd9d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pyrogram/client/types/messages_and_media/photo.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class Photo(Object):
4242
height (``int``):
4343
Photo height.
4444
45-
ttl_seconds (``int``):
46-
Time-to-live seconds, for secret photos.
47-
4845
file_size (``int``):
4946
File size.
5047
5148
date (``int``):
5249
Date the photo was sent in Unix time.
5350
51+
ttl_seconds (``int``, *optional*):
52+
Time-to-live seconds, for secret photos.
53+
5454
thumbs (List of :obj:`Thumbnail`, *optional*):
5555
Available thumbnails of this photo.
5656
"""
@@ -63,20 +63,20 @@ def __init__(
6363
file_ref: str,
6464
width: int,
6565
height: int,
66-
ttl_seconds: int,
6766
file_size: int,
6867
date: int,
69-
thumbs: List[Thumbnail]
68+
ttl_seconds: int = None,
69+
thumbs: List[Thumbnail] = None
7070
):
7171
super().__init__(client)
7272

7373
self.file_id = file_id
7474
self.file_ref = file_ref
7575
self.width = width
7676
self.height = height
77-
self.ttl_seconds = ttl_seconds
7877
self.file_size = file_size
7978
self.date = date
79+
self.ttl_seconds = ttl_seconds
8080
self.thumbs = thumbs
8181

8282
@staticmethod
@@ -96,9 +96,9 @@ def _parse(client, photo: types.Photo, ttl_seconds: int = None) -> "Photo":
9696
file_ref=encode_file_ref(photo.file_reference),
9797
width=big.w,
9898
height=big.h,
99-
ttl_seconds=ttl_seconds,
10099
file_size=big.size,
101100
date=photo.date,
101+
ttl_seconds=ttl_seconds,
102102
thumbs=Thumbnail._parse(client, photo),
103103
client=client
104104
)

pyrogram/client/types/messages_and_media/video.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ class Video(Object):
5151
mime_type (``str``, *optional*):
5252
Mime type of a file as defined by sender.
5353
54-
ttl_seconds (``int``):
55-
Time-to-live seconds, for secret photos.
56-
5754
supports_streaming (``bool``, *optional*):
5855
True, if the video was uploaded with streaming support.
5956
@@ -63,6 +60,9 @@ class Video(Object):
6360
date (``int``, *optional*):
6461
Date the video was sent in Unix time.
6562
63+
ttl_seconds (``int``. *optional*):
64+
Time-to-live seconds, for secret photos.
65+
6666
thumbs (List of :obj:`Thumbnail`, *optional*):
6767
Video thumbnails.
6868
"""
@@ -78,10 +78,10 @@ def __init__(
7878
duration: int,
7979
file_name: str = None,
8080
mime_type: str = None,
81-
ttl_seconds: int = None,
8281
supports_streaming: bool = None,
8382
file_size: int = None,
8483
date: int = None,
84+
ttl_seconds: int = None,
8585
thumbs: List[Thumbnail] = None
8686
):
8787
super().__init__(client)
@@ -93,10 +93,10 @@ def __init__(
9393
self.duration = duration
9494
self.file_name = file_name
9595
self.mime_type = mime_type
96-
self.ttl_seconds = ttl_seconds
9796
self.supports_streaming = supports_streaming
9897
self.file_size = file_size
9998
self.date = date
99+
self.ttl_seconds = ttl_seconds
100100
self.thumbs = thumbs
101101

102102
@staticmethod
@@ -123,10 +123,10 @@ def _parse(
123123
duration=video_attributes.duration,
124124
file_name=file_name,
125125
mime_type=video.mime_type,
126-
ttl_seconds=ttl_seconds,
127126
supports_streaming=video_attributes.supports_streaming,
128127
file_size=video.size,
129128
date=video.date,
129+
ttl_seconds=ttl_seconds,
130130
thumbs=Thumbnail._parse(client, video),
131131
client=client
132132
)

0 commit comments

Comments
 (0)