diff --git a/Telegram/SourceFiles/api/api_credits.cpp b/Telegram/SourceFiles/api/api_credits.cpp index fa6a0b8c5..0ea3384da 100644 --- a/Telegram/SourceFiles/api/api_credits.cpp +++ b/Telegram/SourceFiles/api/api_credits.cpp @@ -36,6 +36,16 @@ constexpr auto kTransactionsLimit = 100; }, [](const auto &) { return PeerId(0); }).value; + const auto isBot = [&] { + if (barePeerId) { + if (const auto p = peer->owner().peer(PeerId(barePeerId))) { + if (const auto u = p->asUser()) { + return u->isBot(); + } + } + } + return false; + }(); return Data::CreditsHistoryEntry{ .id = qs(tl.data().vid()), .title = qs(tl.data().vtitle().value_or_empty()), @@ -65,7 +75,7 @@ constexpr auto kTransactionsLimit = 100; ? base::unixtime::parse(tl.data().vtransaction_date()->v) : QDateTime(), .finishUrl = qs(tl.data().vtransaction_url().value_or_empty()), - .in = (!barePeerId || tl.data().is_refund()) + .in = (!isBot || tl.data().is_refund()) && !tl.data().is_pending() && !tl.data().is_failed(), };