Skip to main content

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.

func (c *Client) PaymentsGetSavedStarGifts(ctx context.Context, request *PaymentsGetSavedStarGiftsRequest) (*PaymentsSavedStarGifts, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PaymentsGetSavedStarGifts(ctx, &tg.PaymentsGetSavedStarGiftsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *PaymentsSavedStarGifts
return nil
})

Parameters

NameTypeRequiredDescription
ExcludeUnsavedboolExclude gifts not pinned on the profile.
ExcludeSavedboolExclude gifts pinned on the profile.
ExcludeUnlimitedboolExclude gifts that do not have the starGift.limited flag set.
ExcludeUniqueboolExclude collectible gifts ».
SortByValueboolIf set, sorts the gifts by price instead of reception date.
ExcludeUpgradableboolExclude gifts that can be upgraded to collectible gifts ».
ExcludeUnupgradableboolExclude gifts that cannot be upgraded to collectible gifts ».
PeerColorAvailableboolPeerColorAvailable field of PaymentsGetSavedStarGiftsRequest.
ExcludeHostedboolExcludeHosted field of PaymentsGetSavedStarGiftsRequest.
PeerInputPeerClassyesFetch 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.
CollectionIDintOnly returns gifts within the specified collection ».
OffsetstringyesOffset for pagination.
LimitintyesMaximum number of results to return, see pagination

Returns

*PaymentsSavedStarGifts

Possible errors

CodeTypeDescription
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400COLLECTION_ID_INVALID
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.

References