public Services(Settings settings, TelegramSettings telegramSettings) { LeadMonitoringSevice = new LeadMonitoringSevice(settings); TelegramService = new TelegramService(telegramSettings, LeadMonitoringSevice); Settings = settings; SerilogSetup(); Reset(); }
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); */ } }
public TelegramService(TelegramSettings telegramSettings, LeadMonitoringSevice services) { _services = services; Reset(telegramSettings); }