jeecrypt / JeeUIFramework

WEB interface and config file for ESP8266 and ESP32
MIT License
94 stars 29 forks source link

UniversalTelegramBot крашится после отправки сообщения 8266-01 #7

Open AndriiIevdoshenko opened 5 years ago

AndriiIevdoshenko commented 5 years ago

привет всем! не могу побороть, хочу добавить настройки телеграмм бота, есть идеи?

нашел https://github.com/me-no-dev/ESPAsyncWebServer/issues/325

include "tmbot.h"

tmbot(param("BOTname"), param("BOTmessage"), param("BOTchatid"), param("token"));

tmbot.h

include

include

String BOTtoken, BOTname, BOTmessage, BOTchatid; WiFiClientSecure ssl_client; UniversalTelegramBot bot(BOTtoken, ssl_client);

void tmbot(String BOTname, String BOTmessage, String BOTchatid, String BOTtoken) { DEBG("BOTname is " + BOTname); DEBG("BOTmessage is " + BOTmessage); DEBG("BOTchatid is " + BOTchatid); DEBG("BOTtoken is " + BOTtoken); DEBG("Sending messages... "); UniversalTelegramBot bot(BOTtoken, ssl_client);

String message = BOTname + "\n"; message += BOTmessage; bot.sendMessage(BOTchatid, message, "");

}

jeecrypt commented 5 years ago

tmbot(param("BOTname"), param("BOTmessage"), param("BOTchatid"), param("token"));

Нужно добавлять после инициализации фреймворка После framework(); в setup