From dfe62e6ccdfce8af3c278a609f292ce7b2ae08f1 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 1 Dec 2024 11:52:45 +0300 Subject: [PATCH] Add nanostar_amount to StarTransaction. --- telegram-bot-api/Client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index be7cd97..30dafea 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -4383,12 +4383,16 @@ class Client::JsonStarTransaction final : public td::Jsonable { auto star_count = transaction_->star_amount_->star_count_; auto nanostar_count = transaction_->star_amount_->nanostar_count_; if (star_count > 0 || nanostar_count > 0) { - object("amount", star_count); object("source", JsonStarTransactionType(transaction_->type_.get(), client_)); } else { - object("amount", -star_count); + star_count = -star_count; + nanostar_count = -nanostar_count; object("receiver", JsonStarTransactionType(transaction_->type_.get(), client_)); } + object("amount", star_count); + if (nanostar_count != 0) { + object("nanostar_amount", nanostar_count); + } } private: