shurillu / CTBot

A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
MIT License
151 stars 35 forks source link

Bot's declaration re-organization #91

Open woodlist opened 2 years ago

woodlist commented 2 years ago

Dear Mr. Stefano, Thanks for library continuous maintenance. Having in mind the lib's usage possibility in different physical ways of connections to the Internet, like Ethernet shield or GSM shield, please, reorganize the bot declaration, as it is implemented in Universal Arduino Telegram Bot, namely, like this: UniversalTelegramBot bot(token, secureClient), where the "bot", "secureClient" are user defined names, the "token" is the token of own bot. In beneath code portion I have used the TinyGSM and UniversalTelegramBot libraries: `#define TINY_GSM_MODEM_SIM800 // Modem is SIM800L

define TINY_GSM_RX_BUFFER 1024

define rand_pin 39

include

define SerialAT Serial1

include // See the source at https://github.com/OPEnSLab-OSU/SSLClient

include "trust_anchors.h" // Certifiacte generation utility: https://openslab-osu.github.io/bearssl-certificate-utility/

TinyGsm modem(SerialAT); // sets GSM modem to serial1

TinyGsmClient GSMclient(modem); // client for GSM

SSLClient sslClient(GSMclient, TAs, (size_t)TAs_NUM, rand_pin);

UniversalTelegramBot bot(BOTtoken, sslClient);`

Thanks in advance.

shurillu commented 2 years ago

Hi woodlist, it could be a great leap for the library, but it need an important code restructuring and at this time I have no time for such changes (my work still crunching my spare time).

So I can schedule it as a future improvement, but with no estimated date ;-)

Stefano