From 5ce8d2ee3e284ef6549e690a1885fcd89df4a073 Mon Sep 17 00:00:00 2001 From: Marcel Walter Date: Thu, 22 Jan 2026 16:12:20 +0100 Subject: [PATCH] fix /text command to work with @Botname and write texts in German --- src/Telegram.cpp | 5 +++-- src/main.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Telegram.cpp b/src/Telegram.cpp index 9576a32..bed9f05 100644 --- a/src/Telegram.cpp +++ b/src/Telegram.cpp @@ -42,10 +42,11 @@ void Telegram::handleNewMessages(int numNewMessages) if (text.startsWith(cmdList[i].command)) { String Arguments = ""; - if (text.length() > cmdList[i].command.length() + 1) + auto posOfFirstSpace = text.indexOf(' '); + if ((posOfFirstSpace > 0) && (text.length() > posOfFirstSpace + 1)) { // Arguments are on space behind the command string - Arguments = text.substring(cmdList[i].command.length() + 1); + Arguments = text.substring(posOfFirstSpace + 1); } if (cmdList[i].functionPointer != nullptr) diff --git a/src/main.cpp b/src/main.cpp index 6846917..f60194e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -284,9 +284,9 @@ void loop() if (WiFi.status() != oldWifiStatus) { /* we freshly disconnected so tell everybody that we are offline */ - Text = "Wifi \""; + Text = "WLAN \""; Text += WIFI_SSID; - Text += "\" not connected"; + Text += "\" nicht verbunden"; ArduinoOTA.end();