Доработан стартер адаптеров
All checks were successful
CI / build-test (push) Successful in 33s
Release / pack-and-publish (release) Successful in 38s

This commit is contained in:
2025-12-05 18:06:12 +03:00
parent 3b57f76579
commit a94327f0c8
12 changed files with 133 additions and 43 deletions

View File

@@ -0,0 +1,22 @@
using BotPages.Core;
namespace BotPages.Telegram;
/// <summary>
/// Расширения для <see cref="BotPagesApp"/>.
/// </summary>
public static class BotPagesAppExtension
{
/// <summary>
/// Добавление адаптера для телеграмм в <see cref="BotPages.Core.Abstractions.IMessengerAdapterFactory"/>
/// </summary>
/// <param name="app"></param>
/// <param name="token"></param>
/// <returns></returns>
public static BotPagesApp AddTelegramAdapter(this BotPagesApp app, string token)
{
var telegram = new TelegramAdapter(app.Logger, token);
app.AddAdapter(telegram.MessagerType, telegram);
return app;
}
}