@@ -51,6 +51,7 @@ async def send_animation(
5151 partial_reply : str = None ,
5252 schedule_date : datetime = None ,
5353 protect_content : bool = None ,
54+ ttl_seconds : int = None ,
5455 reply_markup : Union [
5556 "types.InlineKeyboardMarkup" ,
5657 "types.ReplyKeyboardMarkup" ,
@@ -117,6 +118,12 @@ async def send_animation(
117118 Sends the message silently.
118119 Users will receive a notification with no sound.
119120
121+ ttl_seconds (``int``, *optional*):
122+ Self-Destruct Timer.
123+ If you set a timer, the animation will self-destruct in *ttl_seconds*
124+ seconds after it was viewed.
125+
126+
120127 reply_to_message_id (``int``, *optional*):
121128 If the message is a reply, ID of the original message.
122129
@@ -181,6 +188,9 @@ async def progress(current, total):
181188 print(f"{current * 100 / total:.1f}%")
182189
183190 await app.send_animation("me", "animation.gif", progress=progress)
191+
192+ # Send self-destructing animation message
193+ await app.send_animation("me", "animation.gif", ttl_seconds=10)
184194 """
185195 file = None
186196
@@ -203,7 +213,8 @@ async def progress(current, total):
203213 ),
204214 raw .types .DocumentAttributeFilename (file_name = file_name or os .path .basename (animation )),
205215 raw .types .DocumentAttributeAnimated ()
206- ]
216+ ],
217+ ttl_seconds = ttl_seconds
207218 )
208219 elif re .match ("^https?://" , animation ):
209220 media = raw .types .InputMediaDocumentExternal (
@@ -229,7 +240,8 @@ async def progress(current, total):
229240 ),
230241 raw .types .DocumentAttributeFilename (file_name = file_name or animation .name ),
231242 raw .types .DocumentAttributeAnimated ()
232- ]
243+ ],
244+ ttl_seconds = ttl_seconds
233245 )
234246
235247 reply_to = utils .get_reply_head_fm (message_thread_id , reply_to_message_id , partial_reply )
0 commit comments