OptionalabortOptionaldcDC id from which the file will be downloaded.
If provided DC is not the one storing the file, redirection will be handled automatically.
OptionalfileTotal file size, if known.
Used to determine upload part size.
In some cases can be inferred from file automatically.
OptionallimitNumber of bytes to be downloaded. By default, downloads the entire file
OptionaloffsetOffset in bytes. Must be divisible by 4096 (4 KB).
OptionalpartDownload part size (in KB). By default, automatically selected depending on the file size (or 64, if not provided). Must not be bigger than 512, must not be a fraction, and must be divisible by 4.
OptionalprogressFunction that will be called after some part has been downloaded.
Total file size (Infinity if not available)
OptionalstallIf set, the download will be aborted (and an MtTimeoutError will be thrown)
if no new chunk has been received within this amount of time (in milliseconds).
Useful for bulk downloads where some files might be unavailable server-side
(and would otherwise cause the download to hang indefinitely due to the server
repeatedly responding with FLOOD_WAIT or -503 Timeout).
Abort signal that can be used to cancel the download.