Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public SensorTempCommand(ISensorTempReader sensorTempReader, IPhysSensorInfo physSensorInfo)
 {
     this.physSensorInfo = physSensorInfo;
     callback            = new SensorTempCommandInlineCallback(sensorTempReader);
 }
Ejemplo n.º 3
0
 public ConnectedSensorsController(IPhysSensorInfo sensorInfo)
 {
     this.sensorInfo = sensorInfo;
 }