mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
parent
bf233e3b5b
commit
e0eccfa8fb
@ -201,7 +201,7 @@ class SendAnimation(Scaffold):
|
||||
thumb = await self.save_file(thumb)
|
||||
file = await self.save_file(animation, progress=progress, progress_args=progress_args)
|
||||
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,
|
||||
thumb=thumb,
|
||||
attributes=[
|
||||
@ -211,7 +211,7 @@ class SendAnimation(Scaffold):
|
||||
w=width,
|
||||
h=height
|
||||
),
|
||||
raw.types.DocumentAttributeFilename(file_name=animation.name),
|
||||
raw.types.DocumentAttributeFilename(file_name=file_name or animation.name),
|
||||
raw.types.DocumentAttributeAnimated()
|
||||
]
|
||||
)
|
||||
|
@ -197,7 +197,7 @@ class SendAudio(Scaffold):
|
||||
thumb = await self.save_file(thumb)
|
||||
file = await self.save_file(audio, progress=progress, progress_args=progress_args)
|
||||
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,
|
||||
thumb=thumb,
|
||||
attributes=[
|
||||
@ -206,7 +206,7 @@ class SendAudio(Scaffold):
|
||||
performer=performer,
|
||||
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)
|
||||
file = await self.save_file(document, progress=progress, progress_args=progress_args)
|
||||
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,
|
||||
thumb=thumb,
|
||||
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)
|
||||
file = await self.save_file(video, progress=progress, progress_args=progress_args)
|
||||
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,
|
||||
ttl_seconds=ttl_seconds,
|
||||
thumb=thumb,
|
||||
@ -218,7 +218,7 @@ class SendVideo(Scaffold):
|
||||
w=width,
|
||||
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