public TelegramBotService(
            ILogger <TelegramBotService> logger,
            ISensorTempReader sensorTempReader,
            IPhysSensorInfo physSensorInfo,
            IWeatherForecastService weatherForecastService,
            IServiceScopeFactory scopeFactory,
            IOptions <TelegramBotSettings> options)
        {
            this.logger                 = logger;
            this.sensorTempReader       = sensorTempReader;
            this.physSensorInfo         = physSensorInfo;
            this.weatherForecastService = weatherForecastService;
            this.scopeFactory           = scopeFactory;
            telegramBotSettings         = options.Value;
            token = telegramBotSettings.TelegramBotAPIKey;
            LoadTrustedUsersFromDB();
            trustedUsers.CollectionChanged += TrustedUsers_CollectionChanged;

            botClient = new TelegramBotClient(token)
            {
                Timeout = TimeSpan.FromSeconds(10)
            };
            botClient.OnMessage       += BotClient_OnMessage;
            botClient.OnCallbackQuery += BotClient_OnCallbackQuery;
        }
 public TemperatureController(ISensorTempReader tempReader)
 {
     this.tempReader = tempReader;
 }
 public SensorTempCommand(ISensorTempReader sensorTempReader, IPhysSensorInfo physSensorInfo)
 {
     this.physSensorInfo = physSensorInfo;
     callback            = new SensorTempCommandInlineCallback(sensorTempReader);
 }
Example #4
0
 public TempCommand(ISensorTempReader sensorTempReader)
 {
     this.sensorTempReader = sensorTempReader;
 }
Example #5
0
 public SensorTempCommandInlineCallback(ISensorTempReader sensorTempReader)
 {
     this.sensorTempReader = sensorTempReader;
 }