From f763e27b1c47a2a3dcacb6f81958d18dc29b0a58 Mon Sep 17 00:00:00 2001 From: biver Date: Tue, 18 Oct 2022 10:03:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BE=D1=82=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=A7=D0=B0=D1=82=D0=98=D0=94?= =?UTF-8?q?=20=D0=B2=20TelegramLT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/exec/TelegramLT/TelegramLT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/exec/TelegramLT/TelegramLT.cpp b/src/modules/exec/TelegramLT/TelegramLT.cpp index f57ba04b..19751d69 100644 --- a/src/modules/exec/TelegramLT/TelegramLT.cpp +++ b/src/modules/exec/TelegramLT/TelegramLT.cpp @@ -7,7 +7,7 @@ class TelegramLT : public IoTItem public: String _prevMsg = ""; String _token; - unsigned long _chatID; + String _chatID; TelegramLT(String parameters) : IoTItem(parameters) { jsonRead(parameters, "token", _token); @@ -21,11 +21,11 @@ public: HTTPClient http; http.begin(client, "http://live-control.com/iotm/telegram.php"); http.addHeader("Content-Type", "application/x-www-form-urlencoded"); - String httpRequestData = "url=https://api.telegram.org/bot" + _token + "/sendmessage?chat_id=" + uint64ToString(_chatID) + "&text=" + msg; + String httpRequestData = "url=https://api.telegram.org/bot" + _token + "/sendmessage?chat_id=" + _chatID + "&text=" + msg; int httpResponseCode = http.POST(httpRequestData); String payload = http.getString(); - SerialPrint("<-", F("Telegram"), "chat ID: " + uint64ToString(_chatID) + ", msg: " + msg); - SerialPrint("->", F("Telegram"), "chat ID: " + uint64ToString(_chatID) + ", server: " + httpResponseCode); + SerialPrint("<-", F("Telegram"), "chat ID: " + _chatID + ", msg: " + msg); + SerialPrint("->", F("Telegram"), "chat ID: " + _chatID + ", server: " + httpResponseCode); if (!strstr(payload.c_str(), "{\"ok\":true")) { value.valD = 1;