Example #1
0
 public TelegramBotCore(
     IWeatherPhraseFacade weatherPhraseFacade,
     TelegramBotToken token,
     ITelegramBotClientFactory factory,
     ILogger <TelegramBotCore> logger)
 {
     _weatherPhraseFacade = weatherPhraseFacade;
     _logger = logger;
     _client = factory.GeTelegramBotClient(token.Token);
     _user   = _client.GetMeAsync().Result;
     SubscribeToEvents();
 }
Example #2
0
 public TelegramBot(ITelegramBotClientFactory telegramBotClientFactory)
 {
     this.telegramBotClientFactory = telegramBotClientFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TelegramBotPollingClient" /> class.
 /// </summary>
 /// <param name="messageHandler">Handles the event of a message received by the bot.</param>
 /// <param name="botClientFactory">Factory for getting the <see cref="ITelegramBotClient"/> interface implementations.</param>
 public TelegramBotPollingClient(IBotMessageHandler messageHandler, ITelegramBotClientFactory botClientFactory)
 {
     _messageHandler   = messageHandler;
     _botClientFactory = botClientFactory;
 }