From fc1de34374a20aa2e95c6578248f6e0d8b1f23b0 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 1 Jan 2024 17:47:09 +0300 Subject: [PATCH] Allow to pass empty ReplyParameters. --- telegram-bot-api/Client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 8d18b59..35c4091 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -6418,6 +6418,9 @@ td::Result Client::get_reply_parameters(td::JsonVa return td::Status::Error(400, "Object expected as reply parameters"); } auto &object = value.get_object(); + if (object.field_count() == 0) { + return InputReplyParameters(); + } TRY_RESULT(chat_id, object.get_optional_string_field("chat_id")); TRY_RESULT(message_id, object.get_required_int_field("message_id")); TRY_RESULT(allow_sending_without_reply, object.get_optional_bool_field("allow_sending_without_reply"));