#pragma once #include #include #include struct TelegramCommand { const String command; String (*const functionPointer) (const String arguments); const String description; }; class Telegram { private: static const char *BOT_TOKEN; static const unsigned long BOT_MTBS; // mean time between scan messages unsigned long bot_lasttime; // last time messages' scan has been done WiFiClientSecure &secured_client; UniversalTelegramBot bot; TelegramCommand *cmdList; uint32_t cmdListCount; void handleNewMessages(int numNewMessages); public: Telegram(WiFiClientSecure &sec_client, TelegramCommand commandList[], uint32_t commandListCount); ~Telegram(); void init(); void cyclic(unsigned long now); };