Link Search Menu Expand Document

Method: payments.getSavedStarGifts

Back to methods index

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:

NameTypeDescriptionRequired
exclude_unsavedBoolExclude gifts not pinned on the profile.Optional
exclude_savedBoolExclude gifts pinned on the profile.Optional
exclude_unlimitedBoolExclude gifts that do not have the starGift.limited flag set.Optional
exclude_uniqueBoolExclude collectible gifts ».Optional
sort_by_valueBoolIf set, sorts the gifts by price instead of reception date.Optional
exclude_upgradableBoolExclude gifts that can be upgraded to collectible gifts ».Optional
exclude_unupgradableBoolExclude gifts that cannot be upgraded to collectible gifts ».Optional
peer_color_availableBoolOptional
exclude_hostedBoolOptional
peerUsername, chat ID, Update, Message or InputPeerFetch 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_idintOnly returns gifts within the specified collection ».Optional
offsetstringOffset for pagination.Optional
limitintMaximum number of results to return, see paginationOptional

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, );