Добавлены новые методы отправки сообщений

This commit is contained in:
2026-02-06 04:38:06 +03:00
parent 69ff3cf7d4
commit cd280369bc
25 changed files with 1525 additions and 219 deletions

View File

@@ -1,6 +1,28 @@
namespace BotPages.Core.Abstractions;
using BotPages.Core.Context;
namespace BotPages.Core.Abstractions;
/// <summary>
/// Ключ для идентификации пользовательской сессии.
/// </summary>
public readonly record struct CompositeSessionKey(string MessengerType, string ChatId, string? UserId);
public readonly record struct CompositeSessionKey(string AdapterId, string ChatId, string? UserId)
{
/// <summary>
/// Создает ключ сессии из UpdateContext.
/// </summary>
public static CompositeSessionKey FromUpdate(UpdateContext update)
{
return new CompositeSessionKey(
update.AdapterId,
update.Chat.Id,
update.User.Id);
}
/// <summary>
/// Получить ключ для определенного адаптера.
/// </summary>
public CompositeSessionKey ForAdapter(string adapterId)
{
return new CompositeSessionKey(adapterId, ChatId, UserId);
}
}