Skip to content

Commit 69aca2c

Browse files
Laxilefwi1k1n
andauthored
Send remove_keyboard if empty string is passed; (#2)
Co-authored-by: Ilya Mazlov <mazlov.i.a@gmail.com>
1 parent b79e021 commit 69aca2c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,11 @@ bool UniversalTelegramBot::sendMessageWithReplyKeyboard(
594594
payload["parse_mode"] = parse_mode;
595595

596596
JsonObject replyMarkup = payload.createNestedObject("reply_markup");
597-
598-
replyMarkup["keyboard"] = serialized(keyboard);
597+
598+
if (keyboard.isEmpty())
599+
replyMarkup["remove_keyboard"] = true;
600+
else
601+
replyMarkup["keyboard"] = serialized(keyboard);
599602

600603
// Telegram defaults these values to false, so to decrease the size of the
601604
// payload we will only send them if needed

0 commit comments

Comments
 (0)