Пример #1
0
 /// <summary>
 ///    Provides a string representation of a file.
 /// </summary>
 /// <param name="telegramBot">Extended object</param>
 /// <param name="file">The file to Download. File object is returned by <see cref="TelegramBot.GetFile(string,CancellationToken)"/></param>
 /// <returns>String representation of the downloaded File.</returns>
 public static Task <string> DownloadFileString(this TelegramBot telegramBot, File file) =>
 telegramBot.DownloadFileString(file.FilePath);
Пример #2
0
 /// <summary>
 /// Provides a byte array of a file.
 /// </summary>
 /// <param name="telegramBot">Extended object</param>
 /// <param name="file">The file to Download. File object is returned by <see cref="TelegramBot.GetFile(string,CancellationToken)"/></param>
 /// <returns>Byte array of the file to download.</returns>
 public static Task <byte[]> DownloadFileByteArray(this TelegramBot telegramBot, File file) =>
 telegramBot.DownloadFileByteArray(file.FilePath);
Пример #3
0
 /// <summary>
 ///    Provides a stream to download a file.
 /// </summary>
 /// <param name="telegramBot">Extended object</param>
 /// <param name="file">The file to Download. File object is returned by <see cref="TelegramBot.GetFile(string,CancellationToken)"/></param>
 /// <returns>Stream for the file to download.</returns>
 public static Task <Stream> DownloadFileStream(this TelegramBot telegramBot, File file) =>
 telegramBot.DownloadFileStream(file.FilePath);