Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pyrogram/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ async def ainput(prompt: str = "", *, hide: bool = False):
def get_input_media_from_file_id(
file_id: str,
expected_file_type: FileType = None,
ttl_seconds: int = None
ttl_seconds: int = None,
has_spoiler: bool = None
) -> Union["raw.types.InputMediaPhoto", "raw.types.InputMediaDocument"]:
try:
decoded = FileId.decode(file_id)
Expand All @@ -68,7 +69,8 @@ def get_input_media_from_file_id(
access_hash=decoded.access_hash,
file_reference=decoded.file_reference
),
ttl_seconds=ttl_seconds
ttl_seconds=ttl_seconds,
spoiler=has_spoiler
)

if file_type in DOCUMENT_TYPES:
Expand All @@ -78,7 +80,8 @@ def get_input_media_from_file_id(
access_hash=decoded.access_hash,
file_reference=decoded.file_reference
),
ttl_seconds=ttl_seconds
ttl_seconds=ttl_seconds,
spoiler=has_spoiler
)

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