1e4a474beb
* Removed dependency from TelegramBotWebHost abstraction insode Webhooker * Added extension methods for ASP.NET host
18 lines
677 B
C#
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);
|
|
}
|
|
}
|
|
}
|