cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

USE_CLIENTSSL what is the right choise? #73

Closed joroMaser closed 2 years ago

joroMaser commented 2 years ago

I saw your descriptionhere . But I didn't understand what is the advantage of each choice please? I use esp32wroom

cotestatnt commented 2 years ago

Hi @joroMaser With some old "ESP32 Arduino core" release there was an issue with WiFiClientSecure which cause memory leak sometimes. #5781 #3808

Actually this bug was fixed, so you can choice whatever you prefer as SSLClient

joroMaser commented 2 years ago

So maybe it's better to always use SSLClient instead of WiFiClientSecure 3 more questions please : 1- What is the diffrence between myBot.sendToChannel(msg.chatId, "hi!"); To myBot.sendMessage(msg,"hi");

2) and I think const String &channel in sendToChannel need to be int64_t like chatId in TBMessage no ?

3) sendTo can't send to group / channel? only to user_id?

Thank you

cotestatnt commented 2 years ago

At the moment, with ESP32 release 2.0.1, I'm using only WiFiClientSecure because SSLClient take a very long time to be compiled :( despite to it's very good performance.

A channel it's something different either from users and from groups, so it's necessary a specific method to send message.

sendTo() can send to a group or a to a user (the difference from groups and users are only in the ID where it is negative int64 for groups)