 #include <DNSServer.h>
 #include <ESP8266WebServer.h>
 #include <WiFiManager.h>
+#include <WiFiClientSecure.h>
+#include <UniversalTelegramBot.h>
+
+#define MAX_BUFFER_SIZE 2500
 
 #ifndef _BOT_ID
 #include "telegram.h"
 #endif
+
+WiFiClientSecure client;
+UniversalTelegramBot bot(_BOT_ID, client);
+
+int Bot_mtbs = 1000; //mean time between scan messages
+long Bot_lasttime;   //last time messages' scan has been done
+
+enum Xpos {links, xmitte, rechts};
+enum Ypos {oben, ymitte, unten};
 
 
 //Central European Time (Frankfurt, Paris)

unsigned int debounceInterval = 200;
unsigned int lastJoystick = 0;
bool triggeredJoystick = false;

enum Xpos {links, xmitte, rechts};
enum Ypos {oben, ymitte, unten};

bool WiFiConnected = false;


  wifiManager.autoConnect("WaschmaschineAP");
  WiFiConnected = true;
  timeClient.begin();


  /* String telegram = "https://api.telegram.org/" + String(_BOT_ID) + "/sendMessage?chat_id=" + _CHAT_ID + "&text=" + timeClient.getFormattedTime(); */
  /* Serial.println(telegram); */
  /* HTTPClient http; */
  /* http.begin(telegram); */
  /* int httpCode = http.GET(); */
  /* // httpCode will be negative on error */
  /* if(httpCode > 0) { */
  /*     // HTTP header has been send and Server response header has been handled */
  /*     Serial.printf("[HTTP] GET... code: %d\n", httpCode); */

  /*     // file found at server */
  /*     if(httpCode == HTTP_CODE_OK) { */
  /*         String payload = http.getString(); */
  /*         Serial.println(payload); */
  /*     } */
  /* } else { */
  /*     Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); */
  /* } */
  /* http.end(); */

  ads.begin();
}
