* Architectural rework

This commit is contained in:
2026-03-06 23:19:24 +04:00
parent 74d778e6da
commit 866129f2ff
144 changed files with 413 additions and 368 deletions
@@ -0,0 +1,30 @@
using Microsoft.Extensions.Configuration;
using Telegram.Bot;
using Telegram.Bot.Types;
using Telegrator.Core;
namespace Telegrator.Hosting
{
/// <summary>
/// Implementation of <see cref="ITelegramBotInfo"/> that provides bot information.
/// Contains metadata about the Telegram bot including user details and service provider for wider filterring abilities
/// </summary>
/// <param name="client"></param>
/// <param name="services"></param>
/// <param name="configuration"></param>
public class HostedTelegramBotInfo(ITelegramBotClient client, IServiceProvider services, IConfigurationManager configuration) : ITelegramBotInfo
{
/// <inheritdoc/>
public User User { get; } = client.GetMe().Result;
/// <summary>
/// Provides access to services of this Hosted telegram bot
/// </summary>
public IServiceProvider Services { get; } = services;
/// <summary>
/// Provides access to configuration of this Hosted telegram bot
/// </summary>
public IConfigurationManager Configuration { get; } = configuration;
}
}