diff options
| author | levlam <levlam@telegram.org> | 2026-05-05 18:48:40 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-05-05 18:48:40 +0300 |
| commit | 640c904f86c844ca8bd4e7e500a29c14eb35346d (patch) | |
| tree | 0626025e97ec8c560a100d621747d36187200cd9 | |
| parent | eb6fc396eba0a34b69986a2f166018565bfe7feb (diff) | |
Support InputMediaLivePhoto.
| -rw-r--r-- | telegram-bot-api/Client.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index e8a2d9b..cf5561a 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -11699,6 +11699,16 @@ td::Result<td_api::object_ptr<td_api::InputMessageContent>> Client::get_input_me return make_object<td_api::inputMessagePhoto>(std::move(input_file), nullptr, nullptr, td::vector<int32>(), 0, 0, std::move(caption), show_caption_above_media, nullptr, has_spoiler); } + if (type == "live_photo") { + TRY_RESULT(photo, object.get_optional_string_field("photo")); + auto input_photo = get_input_file(query, td::Slice(), photo, false); + if (input_photo == nullptr) { + return td::Status::Error("photo not found"); + } + return make_object<td_api::inputMessagePhoto>(std::move(input_photo), nullptr, std::move(input_file), + td::vector<int32>(), 0, 0, std::move(caption), + show_caption_above_media, nullptr, has_spoiler); + } if (type == "video") { TRY_RESULT(width, object.get_optional_int_field("width")); TRY_RESULT(height, object.get_optional_int_field("height")); @@ -11787,7 +11797,7 @@ td::Result<td_api::object_ptr<td_api::InputMessageContent>> Client::get_input_po TRY_RESULT(venue, get_venue(object)); return make_object<td_api::inputMessageVenue>(std::move(venue)); } - if (type != "animation" && type != "photo" && type != "video" && + if (type != "animation" && type != "photo" && type != "live_photo" && type != "video" && (for_option ? type != "sticker" : type != "audio" && type != "document")) { return td::Status::Error("invalid type specified"); } |
