Open AndriiIevdoshenko opened 5 years ago
привет всем! не могу побороть, хочу добавить настройки телеграмм бота, есть идеи?
нашел https://github.com/me-no-dev/ESPAsyncWebServer/issues/325
tmbot(param("BOTname"), param("BOTmessage"), param("BOTchatid"), param("token"));
tmbot.h
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, "");
}
Нужно добавлять после инициализации фреймворка После framework(); в setup
привет всем! не могу побороть, хочу добавить настройки телеграмм бота, есть идеи?
нашел 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, "");
}