Link Search Menu Expand Document

Method: account.getPaidMessagesRevenue

Back to methods index

Get the number of stars we have received from the specified user thanks to paid messages »; the received amount will be equal to the sent amount multiplied by stars_paid_message_commission_permille divided by 1000.

Parameters:

NameTypeDescriptionRequired
parent_peerUsername, chat ID, Update, Message or InputPeerIf set, can contain the ID of a monoforum (channel direct messages) to obtain the number of stars the user has spent to send us direct messages via the channel.Optional
user_idUsername, chat ID, Update, Message or InputUserThe user that paid to send us messages.Optional

Return type: account.PaidMessagesRevenue

Can users use this method: YES

Can bots use this method: NO

Can bots use this method over a business connection with the businessConnectionId flag: NO

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$account_PaidMessagesRevenue = $MadelineProto->account->getPaidMessagesRevenue(parent_peer: $InputPeer, user_id: $InputUser, );