From 9288aa5f166d7e55c7360f5983e072df881d5856 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 14 Jun 2024 14:20:25 +0300 Subject: [PATCH] Allow getStarTransactions for bots. --- td/telegram/StarManager.cpp | 4 ++++ td/telegram/Td.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/StarManager.cpp b/td/telegram/StarManager.cpp index 1e4c30a50..7c231988a 100644 --- a/td/telegram/StarManager.cpp +++ b/td/telegram/StarManager.cpp @@ -6,6 +6,7 @@ // #include "td/telegram/StarManager.h" +#include "td/telegram/AuthManager.h" #include "td/telegram/ChatManager.h" #include "td/telegram/DialogId.h" #include "td/telegram/DialogManager.h" @@ -84,6 +85,9 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { UNREACHABLE(); } } + if (td_->auth_manager_->is_bot()) { + flags |= telegram_api::payments_getStarsTransactions::ASCENDING_MASK; + } send_query(G()->net_query_creator().create(telegram_api::payments_getStarsTransactions( flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_peer), offset, limit))); } diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index a3bb58e34..854992db1 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -9498,7 +9498,6 @@ void Td::on_request(uint64 id, const td_api::getStarPaymentOptions &request) { } void Td::on_request(uint64 id, td_api::getStarTransactions &request) { - CHECK_IS_USER(); CLEAN_INPUT_STRING(request.offset_); CREATE_REQUEST_PROMISE(); star_manager_->get_star_transactions(std::move(request.owner_id_), request.offset_, request.limit_,