Files
Telegrator/Telegrator.Localized/LocalizedMessageHandlerExtensions.cs
T
Rikitav 1e4a474beb * Simplified creation of webhost
* Removed dependency from TelegramBotWebHost abstraction insode Webhooker
* Added extension methods for ASP.NET host
2026-03-06 20:49:32 +04:00

18 lines
677 B
C#

using Microsoft.Extensions.Localization;
using System.Collections.Generic;
using System.Threading.Tasks;
using Telegram.Bot.Types;
using Telegrator.Handlers;
namespace Telegrator.Localized
{
public static class LocalizedMessageHandlerExtensions
{
public static async Task<Message> ResponseLocalized(this ILocalizedHandler<Message> localizedHandler, string localizedReplyIdentifier, params IEnumerable<string> formatArgs)
{
LocalizedString localizedString = localizedHandler.LocalizationProvider[localizedReplyIdentifier, formatArgs];
return await localizedHandler.Container.Responce(localizedString.Value);
}
}
}