using BotPages.Core.Abstractions; using BotPages.Core.Messaging; namespace BotPages.Core; /// /// Расширения для работы с /// public static class PageContextAdapterExtensions { /// /// Отправить текстовое сообщение. /// public static Task SendTextAsync(this PageContext ctx, string text, MessageFormat format = MessageFormat.Plain, IEnumerable>? inline = null, IEnumerable>? reply = null, string? messageId = null, CancellationToken ct = default) => ctx.Adapter.SendTextAsync(ctx.Update.Chat.Id, text, format, inline, reply, messageId, ct); /// /// Отправить файл. /// public static Task SendFileAsync(this PageContext ctx, FileDescriptor file, string? caption = null, MessageFormat? captionFormat = null, IEnumerable>? inline = null, IEnumerable>? reply = null, CancellationToken ct = default ) => ctx.Adapter.SendFileAsync(chatId: ctx.Update.Chat.Id, file: file, caption: caption, captionFormat: captionFormat, inline: inline, reply: reply, ct: ct); }