mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
parent
bf233e3b5b
commit
e0eccfa8fb
@ -201,7 +201,7 @@ class SendAnimation(Scaffold):
|
|||||||
thumb = await self.save_file(thumb)
|
thumb = await self.save_file(thumb)
|
||||||
file = await self.save_file(animation, progress=progress, progress_args=progress_args)
|
file = await self.save_file(animation, progress=progress, progress_args=progress_args)
|
||||||
media = raw.types.InputMediaUploadedDocument(
|
media = raw.types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(animation.name) or "video/mp4",
|
mime_type=self.guess_mime_type(file_name or animation.name) or "video/mp4",
|
||||||
file=file,
|
file=file,
|
||||||
thumb=thumb,
|
thumb=thumb,
|
||||||
attributes=[
|
attributes=[
|
||||||
@ -211,7 +211,7 @@ class SendAnimation(Scaffold):
|
|||||||
w=width,
|
w=width,
|
||||||
h=height
|
h=height
|
||||||
),
|
),
|
||||||
raw.types.DocumentAttributeFilename(file_name=animation.name),
|
raw.types.DocumentAttributeFilename(file_name=file_name or animation.name),
|
||||||
raw.types.DocumentAttributeAnimated()
|
raw.types.DocumentAttributeAnimated()
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -197,7 +197,7 @@ class SendAudio(Scaffold):
|
|||||||
thumb = await self.save_file(thumb)
|
thumb = await self.save_file(thumb)
|
||||||
file = await self.save_file(audio, progress=progress, progress_args=progress_args)
|
file = await self.save_file(audio, progress=progress, progress_args=progress_args)
|
||||||
media = raw.types.InputMediaUploadedDocument(
|
media = raw.types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(audio.name) or "audio/mpeg",
|
mime_type=self.guess_mime_type(file_name or audio.name) or "audio/mpeg",
|
||||||
file=file,
|
file=file,
|
||||||
thumb=thumb,
|
thumb=thumb,
|
||||||
attributes=[
|
attributes=[
|
||||||
@ -206,7 +206,7 @@ class SendAudio(Scaffold):
|
|||||||
performer=performer,
|
performer=performer,
|
||||||
title=title
|
title=title
|
||||||
),
|
),
|
||||||
raw.types.DocumentAttributeFilename(file_name=audio.name)
|
raw.types.DocumentAttributeFilename(file_name=file_name or audio.name)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -180,11 +180,11 @@ class SendDocument(Scaffold):
|
|||||||
thumb = await self.save_file(thumb)
|
thumb = await self.save_file(thumb)
|
||||||
file = await self.save_file(document, progress=progress, progress_args=progress_args)
|
file = await self.save_file(document, progress=progress, progress_args=progress_args)
|
||||||
media = raw.types.InputMediaUploadedDocument(
|
media = raw.types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(document.name) or "application/zip",
|
mime_type=self.guess_mime_type(file_name or document.name) or "application/zip",
|
||||||
file=file,
|
file=file,
|
||||||
thumb=thumb,
|
thumb=thumb,
|
||||||
attributes=[
|
attributes=[
|
||||||
raw.types.DocumentAttributeFilename(file_name=document.name)
|
raw.types.DocumentAttributeFilename(file_name=file_name or document.name)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ class SendVideo(Scaffold):
|
|||||||
thumb = await self.save_file(thumb)
|
thumb = await self.save_file(thumb)
|
||||||
file = await self.save_file(video, progress=progress, progress_args=progress_args)
|
file = await self.save_file(video, progress=progress, progress_args=progress_args)
|
||||||
media = raw.types.InputMediaUploadedDocument(
|
media = raw.types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(video.name) or "video/mp4",
|
mime_type=self.guess_mime_type(file_name or video.name) or "video/mp4",
|
||||||
file=file,
|
file=file,
|
||||||
ttl_seconds=ttl_seconds,
|
ttl_seconds=ttl_seconds,
|
||||||
thumb=thumb,
|
thumb=thumb,
|
||||||
@ -218,7 +218,7 @@ class SendVideo(Scaffold):
|
|||||||
w=width,
|
w=width,
|
||||||
h=height
|
h=height
|
||||||
),
|
),
|
||||||
raw.types.DocumentAttributeFilename(file_name=video.name)
|
raw.types.DocumentAttributeFilename(file_name=file_name or video.name)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user