@@ -37,6 +37,7 @@ async def send_video(
3737 caption : str = "" ,
3838 parse_mode : Union [str , None ] = object ,
3939 caption_entities : List ["types.MessageEntity" ] = None ,
40+ ttl_seconds : int = None ,
4041 duration : int = 0 ,
4142 width : int = 0 ,
4243 height : int = 0 ,
@@ -83,6 +84,11 @@ async def send_video(
8384 caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
8485 List of special entities that appear in the caption, which can be specified instead of __parse_mode__.
8586
87+ ttl_seconds (``int``, *optional*):
88+ Self-Destruct Timer.
89+ If you set a timer, the video will self-destruct in *ttl_seconds*
90+ seconds after it was viewed.
91+
8692 duration (``int``, *optional*):
8793 Duration of sent video in seconds.
8894
@@ -155,6 +161,9 @@ async def send_video(
155161 # Add caption to the video
156162 app.send_video("me", "video.mp4", caption="recording")
157163
164+ # Send self-destructing video
165+ app.send_photo("me", "video.mp4", ttl_seconds=10)
166+
158167 # Keep track of the progress while uploading
159168 def progress(current, total):
160169 print(f"{current * 100 / total:.1f}%")
@@ -171,6 +180,7 @@ def progress(current, total):
171180 media = raw .types .InputMediaUploadedDocument (
172181 mime_type = self .guess_mime_type (video ) or "video/mp4" ,
173182 file = file ,
183+ ttl_seconds = ttl_seconds ,
174184 thumb = thumb ,
175185 attributes = [
176186 raw .types .DocumentAttributeVideo (
@@ -184,7 +194,8 @@ def progress(current, total):
184194 )
185195 elif re .match ("^https?://" , video ):
186196 media = raw .types .InputMediaDocumentExternal (
187- url = video
197+ url = video ,
198+ ttl_seconds = ttl_seconds
188199 )
189200 else :
190201 media = utils .get_input_media_from_file_id (video , FileType .VIDEO )
@@ -194,6 +205,7 @@ def progress(current, total):
194205 media = raw .types .InputMediaUploadedDocument (
195206 mime_type = self .guess_mime_type (video .name ) or "video/mp4" ,
196207 file = file ,
208+ ttl_seconds = ttl_seconds ,
197209 thumb = thumb ,
198210 attributes = [
199211 raw .types .DocumentAttributeVideo (
0 commit comments