Pyrofork: Add spoiler support when sending animation, photo, and video using file_id #14

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-07-27 15:13:26 +07:00
parent acb08eb990
commit 51e5586c74
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
3 changed files with 3 additions and 0 deletions

View file

@ -213,6 +213,7 @@ class SendAnimation:
)
else:
media = utils.get_input_media_from_file_id(animation, FileType.ANIMATION)
media.spoiler = has_spoiler
else:
thumb = await self.save_file(thumb)
file = await self.save_file(animation, progress=progress, progress_args=progress_args)

View file

@ -174,6 +174,7 @@ class SendPhoto:
)
else:
media = utils.get_input_media_from_file_id(photo, FileType.PHOTO, ttl_seconds=ttl_seconds)
media.spoiler = has_spoiler
else:
file = await self.save_file(photo, progress=progress, progress_args=progress_args)
media = raw.types.InputMediaUploadedPhoto(

View file

@ -219,6 +219,7 @@ class SendVideo:
)
else:
media = utils.get_input_media_from_file_id(video, FileType.VIDEO, ttl_seconds=ttl_seconds)
media.spoiler = has_spoiler
else:
thumb = await self.save_file(thumb)
file = await self.save_file(video, progress=progress, progress_args=progress_args)