Files
BotPages/BotPages.Core/Transport/IFileService.cs

28 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace BotPages.Core
{
/// <summary>
/// Сервис работы с файлами: загрузка и отправка пакетами.
/// </summary>
public interface IFileService
{
/// <summary>
/// Загружает файл по идентификатору транспорта.
/// </summary>
Task<FileDescriptor> DownloadAsync(string fileId, CancellationToken ct);
/// <summary>
/// Загружает несколько файлов по их идентификаторам.
/// </summary>
Task<IReadOnlyList<FileDescriptor>> DownloadManyAsync(IEnumerable<string> fileIds, CancellationToken ct);
/// <summary>
/// Отправляет один файл в чат.
/// </summary>
Task SendAsync(IChatClient client, long chatId, FileDescriptor file, CancellationToken ct);
/// <summary>
/// Отправляет несколько файлов в чат.
/// </summary>
Task SendManyAsync(IChatClient client, long chatId, IEnumerable<FileDescriptor> files, CancellationToken ct);
}
}