Добавлена возможность отсылать сообщения в другие чаты
All checks were successful
CI / build-test (push) Successful in 33s

This commit is contained in:
2025-12-05 19:45:59 +03:00
parent a94327f0c8
commit 634a9292dc
5 changed files with 29 additions and 27 deletions

View File

@@ -9,17 +9,19 @@ namespace BotPages.Core.Abstractions;
/// </summary>
public interface IMessengerAdapter
{
Capabilities Capabilities { get; }
/// <summary>
/// Отправить текстовое сообщение в чат.
/// </summary>
Task SendTextAsync(PageContext ctx, string text, MessageFormat format,
Task SendTextAsync(string chatId, string text, MessageFormat format,
IEnumerable<IEnumerable<InlineButton>>? inline,
IEnumerable<IEnumerable<ReplyButton>>? reply, CancellationToken ct);
/// <summary>
/// Отправить файл в чат.
/// </summary>
Task SendFileAsync(PageContext ctx, FileDescriptor file, string? caption, CancellationToken ct);
Task SendFileAsync(string chatId, FileDescriptor file, string? caption, CancellationToken ct);
/// <summary>
/// Создать билдер альбома для отправки медиагруппы.

View File

@@ -49,13 +49,13 @@ public sealed class PageContext
IEnumerable<IEnumerable<InlineButton>>? inline = null,
IEnumerable<IEnumerable<ReplyButton>>? reply = null,
CancellationToken ct = default)
=> Adapter.SendTextAsync(this, text, format, inline, reply, ct);
=> Adapter.SendTextAsync(this.Update.Chat.Id, text, format, inline, reply, ct);
/// <summary>
/// Отправить файл.
/// </summary>
public Task SendFileAsync(FileDescriptor file, string? caption = null, CancellationToken ct = default)
=> Adapter.SendFileAsync(this, file, caption, ct);
=> Adapter.SendFileAsync(this.Update.Chat.Id, file, caption, ct);
/// <summary>
/// Получить билдер альбомов.