Skip to content

Commit

Permalink
Merge pull request #77 from naftali100/fix-limit-param
Browse files Browse the repository at this point in the history
add missing limit params
  • Loading branch information
cavallium authored Oct 30, 2022
2 parents bcc8c6e + 3384d70 commit 0e6f6bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions telegram-bot-api/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9654,7 +9654,9 @@ td::Status Client::process_disable_proxy_query(PromisedQueryPtr &query) {

td::Status Client::process_get_chats_query(PromisedQueryPtr &query) {
CHECK_IS_USER();
send_request(make_object<td_api::getChats>(make_object<td_api::chatListMain>(), 100),
td::int32 limit = get_integer_arg(query.get(), "limit", 100, 0, 100);

send_request(make_object<td_api::getChats>(make_object<td_api::chatListMain>(), limit),
td::make_unique<TdOnGetChatsCallback>(this, std::move(query)));
return Status::OK();
}
Expand All @@ -9663,8 +9665,9 @@ td::Status Client::process_get_common_chats_query(PromisedQueryPtr &query) {
CHECK_IS_USER();
TRY_RESULT(user_id, get_user_id(query.get()));
td::int64 offset_chat_id = get_integer_arg(query.get(), "offset_chat_id", 0);
td::int32 limit = get_integer_arg(query.get(), "limit", 100, 0, 100);

send_request(make_object<td_api::getGroupsInCommon>(user_id, offset_chat_id, 100),
send_request(make_object<td_api::getGroupsInCommon>(user_id, offset_chat_id, limit),
td::make_unique<TdOnGetChatsCallback>(this, std::move(query)));
return Status::OK();
}
Expand Down

0 comments on commit 0e6f6bc

Please sign in to comment.