From 9693037ef2023bfa08dcaf6dfa91933762eafc29 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Fri, 31 Oct 2025 00:31:30 +0100 Subject: [PATCH] Added missing DownloadFileAsync(doc, videoSize) --- src/Client.Helpers.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs index 6faa509..8a3768f 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -361,6 +361,18 @@ namespace WTelegram return thumbSize == null ? document.mime_type : "image/" + fileType; } + /// Download a document from Telegram into the outputStream + /// The document to download + /// Stream to write the file content to. This method does not close/dispose the stream + /// A specific size/version of the animated photo. Use photo.LargestVideoSize to download the largest version of the animated photo + /// (optional) Callback for tracking the progression of the transfer + /// MIME type of the document/thumbnail + public async Task DownloadFileAsync(Document document, Stream outputStream, VideoSize videoSize, ProgressCallback progress = null) + { + var fileLocation = document.ToFileLocation(videoSize); + return await DownloadFileAsync(fileLocation, outputStream, document.dc_id, videoSize.size, progress); + } + /// Download a file from Telegram into the outputStream /// Telegram file identifier, typically obtained with a .ToFileLocation() call /// Stream to write file content to. This method does not close/dispose the stream