miniproto.file_id.encode_file_id
miniproto.file_id.encode_file_id
Section titled “miniproto.file_id.encode_file_id”encode_file_id(media: Media | object) -> strEncode supported Telegram media or input locations into a local file ID.
Fields are serialized as supplied. Decoding applies integer-range and size limits, so invalid source fields can produce an ID that decode_file_id rejects. Encoding makes no Telegram request and does not renew file references.
Parameters:
Returns:
str– Canonical URL-safempf1_identifier containing the reusable location fields.
Raises:
TypeError– If the location shape is unsupported or an extracted field is not JSON-serializable.ValueError– If JSON serialization rejects an extracted value.