public Services(Settings settings, TelegramSettings telegramSettings)
 {
     LeadMonitoringSevice = new LeadMonitoringSevice(settings);
     TelegramService      = new TelegramService(telegramSettings, LeadMonitoringSevice);
     Settings             = settings;
     SerilogSetup();
     Reset();
 }
Пример #2
0
 public void Reset(TelegramSettings telegramSettings)
 {
     TelegramSettings = telegramSettings;
     try
     {
         if (string.IsNullOrWhiteSpace(TelegramSettings.ApiId) ||
             string.IsNullOrWhiteSpace(TelegramSettings.ApiHash) ||
             string.IsNullOrWhiteSpace(TelegramSettings.NumberToAuthenticate) ||
             string.IsNullOrWhiteSpace(TelegramSettings.CodeToAuthenticate))
         {
             return;
         }
         TelegramClient = new TelegramClient(int.Parse(TelegramSettings.ApiId), TelegramSettings.ApiHash);
         //AuthUser().Wait();
     }
     catch (MissingApiConfigurationException ex)
     {
         /*
          * throw new Exception(
          *      $"Please add your API settings to the `app.config` file. (More info: {MissingApiConfigurationException.InfoUrl})",
          *      ex);
          */
     }
 }
Пример #3
0
 public TelegramService(TelegramSettings telegramSettings, LeadMonitoringSevice services)
 {
     _services = services;
     Reset(telegramSettings);
 }