mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-23 02:17:39 +00:00
Add InputPaidMediaVideo.cover.
This commit is contained in:
parent
f5bf77fc07
commit
dcee0b9e50
@ -9936,9 +9936,12 @@ td::Result<td_api::object_ptr<td_api::inputPaidMedia>> Client::get_input_paid_me
|
|||||||
} else if (type == "video") {
|
} else if (type == "video") {
|
||||||
TRY_RESULT(duration, object.get_optional_int_field("duration"));
|
TRY_RESULT(duration, object.get_optional_int_field("duration"));
|
||||||
TRY_RESULT(supports_streaming, object.get_optional_bool_field("supports_streaming"));
|
TRY_RESULT(supports_streaming, object.get_optional_bool_field("supports_streaming"));
|
||||||
|
TRY_RESULT(cover, object.get_optional_string_field("cover"));
|
||||||
TRY_RESULT(start_timestamp, object.get_optional_int_field("start_timestamp"));
|
TRY_RESULT(start_timestamp, object.get_optional_int_field("start_timestamp"));
|
||||||
|
auto cover_input_file = get_input_file(query, "cover", cover, false);
|
||||||
duration = td::clamp(duration, 0, MAX_DURATION);
|
duration = td::clamp(duration, 0, MAX_DURATION);
|
||||||
media_type = make_object<td_api::inputPaidMediaTypeVideo>(nullptr, start_timestamp, duration, supports_streaming);
|
media_type = make_object<td_api::inputPaidMediaTypeVideo>(std::move(cover_input_file), start_timestamp, duration,
|
||||||
|
supports_streaming);
|
||||||
} else {
|
} else {
|
||||||
return td::Status::Error(PSLICE() << "type \"" << type << "\" is unsupported");
|
return td::Status::Error(PSLICE() << "type \"" << type << "\" is unsupported");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user