mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-29 19:08:46 +00:00
Immediately return an error if more than 50 inline query results are provided.
This commit is contained in:
parent
70670d7217
commit
95ff757c73
@ -6232,6 +6232,10 @@ td::Result<td::vector<td_api::object_ptr<td_api::InputInlineQueryResult>>> Clien
|
|||||||
if (values.type() != td::JsonValue::Type::Array) {
|
if (values.type() != td::JsonValue::Type::Array) {
|
||||||
return td::Status::Error(400, "Expected an Array of inline query results");
|
return td::Status::Error(400, "Expected an Array of inline query results");
|
||||||
}
|
}
|
||||||
|
constexpr std::size_t MAX_INLINE_QUERY_RESULT_COUNT = 50;
|
||||||
|
if (values.get_array().size() > MAX_INLINE_QUERY_RESULT_COUNT) {
|
||||||
|
return td::Status::Error(400, "Too many inline query results specified");
|
||||||
|
}
|
||||||
|
|
||||||
td::vector<object_ptr<td_api::InputInlineQueryResult>> inline_query_results;
|
td::vector<object_ptr<td_api::InputInlineQueryResult>> inline_query_results;
|
||||||
for (auto &value : values.get_array()) {
|
for (auto &value : values.get_array()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user