Method: bots.updateStarRefProgram
Create, edit or delete the affiliate program of a bot we own
Parameters:
Name | Type | Description | Required |
---|---|---|---|
bot | Username, chat ID, Update, Message or InputUser | The bot | Optional |
commission_permille | int | The permille commission rate: it indicates the share of Telegram Stars received by affiliates for every transaction made by users they referred inside of the bot. The minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters. Can be 0 to terminate the affiliate program.Both the duration and the commission may only be raised after creation of the program: to lower them, the program must first be terminated and a new one created. | Optional |
duration_months | int | Indicates the duration of the affiliate program; if not set, there is no expiration date. | Optional |
Return type: StarRefProgram
Can userbots use this method: YES
Can bots use this method: 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();
$StarRefProgram = $MadelineProto->bots->updateStarRefProgram(bot: $InputUser, commission_permille: $int, duration_months: $int, );