From 3438e4a766aacda385b0d975759129bd50836345 Mon Sep 17 00:00:00 2001 From: Emilio Molinari <17145424+xates@users.noreply.github.com> Date: Fri, 14 Jul 2023 12:04:20 +0200 Subject: [PATCH] Send editMessageReplyMarkup to Telegram when passing empty text to sendMessageWithInlineKeyboard method --- src/UniversalTelegramBot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniversalTelegramBot.cpp b/src/UniversalTelegramBot.cpp index fbb1ac7..9882278 100644 --- a/src/UniversalTelegramBot.cpp +++ b/src/UniversalTelegramBot.cpp @@ -641,7 +641,7 @@ bool UniversalTelegramBot::sendPostMessage(JsonObject payload, bool edit) { // a if (payload.containsKey("text")) { while (millis() < sttime + 8000) { // loop for a while to send the message - String response = sendPostToTelegram((edit ? BOT_CMD("editMessageText") : BOT_CMD("sendMessage")), payload); // if edit is true we send a editMessageText CMD + String response = sendPostToTelegram((edit ? payload["text"] == "" ? BOT_CMD("editMessageReplyMarkup") : BOT_CMD("editMessageText") : BOT_CMD("sendMessage")), payload); // if edit is true we send a editMessageText CMD #ifdef TELEGRAM_DEBUG Serial.println(response); #endif