aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-07-04 00:12:45 +0300
committerlevlam <levlam@telegram.org>2026-07-04 00:12:45 +0300
commita2cde3781bc62da55e872e9763d423cd0036e06c (patch)
treee4f9fadf3e9044af60956a342f02e5bd1ef00e0a
parentfe131c7a444fc43431f3bc888c7802e38aa8fca9 (diff)
Simplify Client::get_inline_query_results.
-rw-r--r--telegram-bot-api/Client.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp
index 23a2e86..613769e 100644
--- a/telegram-bot-api/Client.cpp
+++ b/telegram-bot-api/Client.cpp
@@ -10873,18 +10873,14 @@ td::Result<td::vector<td_api::object_ptr<td_api::InputInlineQueryResult>>> Clien
td::Result<td::vector<td_api::object_ptr<td_api::InputInlineQueryResult>>> Client::get_inline_query_results(
const Query *query, td::JsonValue &&values, BotUserIds &bot_user_ids) const {
- if (values.type() == td::JsonValue::Type::Null) {
- return td::vector<object_ptr<td_api::InputInlineQueryResult>>();
- }
+ td::vector<object_ptr<td_api::InputInlineQueryResult>> inline_query_results;
if (values.type() != td::JsonValue::Type::Array) {
+ if (values.type() == td::JsonValue::Type::Null) {
+ return std::move(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;
for (auto &value : values.get_array()) {
auto r_inline_query_result = get_inline_query_result(query, std::move(value), bot_user_ids);
if (r_inline_query_result.is_error()) {