Files
Telegrator/src/Telegrator.Hosting/Hosting/HostedTelegramBotInfo.cs
T

31 lines
1.1 KiB
C#
Raw Normal View History

using Microsoft.Extensions.Configuration;
using Telegram.Bot;
using Telegram.Bot.Types;
2026-03-06 23:19:24 +04:00
using Telegrator.Core;
namespace Telegrator.Hosting
{
2025-08-01 15:11:05 +04:00
/// <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;
2025-08-01 15:11:05 +04:00
/// <summary>
/// Provides access to services of this Hosted telegram bot
/// </summary>
public IServiceProvider Services { get; } = services;
2025-08-01 15:11:05 +04:00
/// <summary>
/// Provides access to configuration of this Hosted telegram bot
/// </summary>
public IConfigurationManager Configuration { get; } = configuration;
}
}