Skip to content

Commit

Permalink
Mark DownloadFileAsync obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
poulad committed Sep 1, 2018
1 parent c0798a9 commit c44ecd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Property `ITelegramBotClient.BotId`
- Property `Message.PassportData`

### Changed

- Marked `DownloadFileAsync(string,CancellationToken)` obsolete.

## [14.9.0] - 2018-08-06

### Added
Expand Down
5 changes: 3 additions & 2 deletions src/Telegram.Bot/ITelegramBotClient.cs
Expand Up @@ -689,8 +689,9 @@ public interface ITelegramBotClient
/// Use this method to download a file. Get <paramref name="filePath"/> by calling <see cref="GetFileAsync"/>
/// </summary>
/// <param name="filePath">Path to file on server</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <param name="cancellationToken">The cancellation token to cancel operation</param>
/// <returns>File stream</returns>
[Obsolete("This method will be removed in next major release. Use its overload instead.")]
Task<Stream> DownloadFileAsync(
string filePath,
CancellationToken cancellationToken = default);
Expand All @@ -700,7 +701,7 @@ public interface ITelegramBotClient
/// </summary>
/// <param name="filePath">Path to file on server</param>
/// <param name="destination">Destination stream to write file to</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <param name="cancellationToken">The cancellation token to cancel operation</param>
Task DownloadFileAsync(
string filePath,
Stream destination,
Expand Down
1 change: 1 addition & 0 deletions src/Telegram.Bot/TelegramBotClient.cs
Expand Up @@ -784,6 +784,7 @@ public Task<User> GetMeAsync(CancellationToken cancellationToken = default)
MakeRequestAsync(new GetFileRequest(fileId), cancellationToken);

/// <inheritdoc />
[Obsolete("This method will be removed in next major release. Use its overload instead.")]
public async Task<Stream> DownloadFileAsync(
string filePath,
CancellationToken cancellationToken = default
Expand Down

0 comments on commit c44ecd4

Please sign in to comment.