Skip to content

Commit 99f6e4b

Browse files
Fix a bug where "null" was sent as keyboard markup
Only send keyboard markup array if it is not empty
1 parent 2984a06 commit 99f6e4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ String UniversalTelegramBot::sendPhoto(String chat_id, String photo,
694694
if (reply_to_message_id && reply_to_message_id != 0)
695695
payload["reply_to_message_id"] = reply_to_message_id;
696696

697-
if (keyboard) {
697+
if (!keyboard.isEmpty()) {
698698
JsonObject replyMarkup = payload.createNestedObject("reply_markup");
699699
DynamicJsonDocument keyboardBuffer(maxMessageLength); // assuming keyboard buffer will alwas be limited to 1024 bytes
700700
deserializeJson(keyboardBuffer, keyboard);

0 commit comments

Comments
 (0)