Доработан стартер адаптеров
This commit is contained in:
22
BotPages.Telegram/BotPagesAppExtension.cs
Normal file
22
BotPages.Telegram/BotPagesAppExtension.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user