Method: payments.convertStarGift
Convert a received gift » into Telegram Stars: this will permanently destroy the gift, converting it into starGift.convert_stars Telegram Stars, added to the user’s balance.
Note that starGift.convert_stars will be less than the buying price (starGift.stars) of the gift if it was originally bought using Telegram Stars bought a long time ago.
Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
| stargift | InputSavedStarGift | The gift to convert. | Yes |
Return type: Bool
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: YES
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();
$Bool = $MadelineProto->payments->convertStarGift(stargift: $InputSavedStarGift, );