Method: payments.getSavedStarGifts
Fetch the full list of gifts owned by a peer.
Note that unlike what the name suggests, the method can be used to fetch both “saved” and “unsaved” gifts (aka gifts both pinned and not pinned) to the profile, depending on the passed flags.
Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
| exclude_unsaved | Bool | Exclude gifts not pinned on the profile. | Optional |
| exclude_saved | Bool | Exclude gifts pinned on the profile. | Optional |
| exclude_unlimited | Bool | Exclude gifts that do not have the starGift.limited flag set. | Optional |
| exclude_unique | Bool | Exclude collectible gifts ». | Optional |
| sort_by_value | Bool | If set, sorts the gifts by price instead of reception date. | Optional |
| exclude_upgradable | Bool | Exclude gifts that can be upgraded to collectible gifts ». | Optional |
| exclude_unupgradable | Bool | Exclude gifts that cannot be upgraded to collectible gifts ». | Optional |
| peer_color_available | Bool | Optional | |
| exclude_hosted | Bool | Optional | |
| peer | Username, chat ID, Update, Message or InputPeer | Fetch only gifts owned by the specified peer, such as: a user, with peer=inputPeerUser; a channel, with peer=inputPeerChannel; a connected business user (when executing the method as a bot, over the business connection), with peer=inputPeerUser. | Optional |
| collection_id | int | Only returns gifts within the specified collection ». | Optional |
| offset | string | Offset for pagination. | Optional |
| limit | int | Maximum number of results to return, see pagination | Optional |
Return type: payments.SavedStarGifts
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();
$payments_SavedStarGifts = $MadelineProto->payments->getSavedStarGifts(exclude_unsaved: $Bool, exclude_saved: $Bool, exclude_unlimited: $Bool, exclude_unique: $Bool, sort_by_value: $Bool, exclude_upgradable: $Bool, exclude_unupgradable: $Bool, peer_color_available: $Bool, exclude_hosted: $Bool, peer: $InputPeer, collection_id: $int, offset: 'string', limit: $int, );