Skip to content

Commit 11fd73c

Browse files
authored
Fixed missing has_spoiler in get_input_media_from_file_id() method (#13)
1 parent 35c7ec7 commit 11fd73c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

pyrogram/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ async def ainput(prompt: str = "", *, hide: bool = False):
4343
def get_input_media_from_file_id(
4444
file_id: str,
4545
expected_file_type: FileType = None,
46-
ttl_seconds: int = None
46+
ttl_seconds: int = None,
47+
has_spoiler: bool = None
4748
) -> Union["raw.types.InputMediaPhoto", "raw.types.InputMediaDocument"]:
4849
try:
4950
decoded = FileId.decode(file_id)
@@ -68,7 +69,8 @@ def get_input_media_from_file_id(
6869
access_hash=decoded.access_hash,
6970
file_reference=decoded.file_reference
7071
),
71-
ttl_seconds=ttl_seconds
72+
ttl_seconds=ttl_seconds,
73+
spoiler=has_spoiler
7274
)
7375

7476
if file_type in DOCUMENT_TYPES:
@@ -78,7 +80,8 @@ def get_input_media_from_file_id(
7880
access_hash=decoded.access_hash,
7981
file_reference=decoded.file_reference
8082
),
81-
ttl_seconds=ttl_seconds
83+
ttl_seconds=ttl_seconds,
84+
spoiler=has_spoiler
8285
)
8386

8487
raise ValueError(f"Unknown file id: {file_id}")

0 commit comments

Comments
 (0)