mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add missing asyncio keywords (#319)
* fix missing await * fix empty file reference * one more await, and file reference
This commit is contained in:
parent
48aaaf9a0d
commit
2daa5932c6
@ -108,7 +108,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(media.media) or "video/mp4",
|
mime_type=self.guess_mime_type(media.media) or "video/mp4",
|
||||||
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
thumb=None if media.thumb is None else await self.save_file(media.thumb),
|
||||||
file=await self.save_file(media.media),
|
file=await self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeVideo(
|
types.DocumentAttributeVideo(
|
||||||
@ -145,7 +145,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(media.media) or "audio/mpeg",
|
mime_type=self.guess_mime_type(media.media) or "audio/mpeg",
|
||||||
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
thumb=None if media.thumb is None else await self.save_file(media.thumb),
|
||||||
file=await self.save_file(media.media),
|
file=await self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeAudio(
|
types.DocumentAttributeAudio(
|
||||||
@ -165,7 +165,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
id=types.InputDocument(
|
id=types.InputDocument(
|
||||||
id=media.document.id,
|
id=media.document.id,
|
||||||
access_hash=media.document.access_hash,
|
access_hash=media.document.access_hash,
|
||||||
file_reference=b""
|
file_reference=media.document.file_reference
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif media.media.startswith("http"):
|
elif media.media.startswith("http"):
|
||||||
@ -203,7 +203,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
id=types.InputDocument(
|
id=types.InputDocument(
|
||||||
id=media.document.id,
|
id=media.document.id,
|
||||||
access_hash=media.document.access_hash,
|
access_hash=media.document.access_hash,
|
||||||
file_reference=b""
|
file_reference=media.document.file_reference
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif media.media.startswith("http"):
|
elif media.media.startswith("http"):
|
||||||
@ -219,7 +219,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaUploadedDocument(
|
media=types.InputMediaUploadedDocument(
|
||||||
mime_type=self.guess_mime_type(media.media) or "application/zip",
|
mime_type=self.guess_mime_type(media.media) or "application/zip",
|
||||||
thumb=None if media.thumb is None else self.save_file(media.thumb),
|
thumb=None if media.thumb is None else await self.save_file(media.thumb),
|
||||||
file=await self.save_file(media.media),
|
file=await self.save_file(media.media),
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeFilename(
|
types.DocumentAttributeFilename(
|
||||||
@ -234,7 +234,7 @@ class EditMessageMedia(BaseClient):
|
|||||||
id=types.InputDocument(
|
id=types.InputDocument(
|
||||||
id=media.document.id,
|
id=media.document.id,
|
||||||
access_hash=media.document.access_hash,
|
access_hash=media.document.access_hash,
|
||||||
file_reference=b""
|
file_reference=media.document.file_reference
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif media.media.startswith("http"):
|
elif media.media.startswith("http"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user