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
ExcludeUnsavedbool—Exclude gifts not pinned on the profile.
ExcludeSavedbool—Exclude gifts pinned on the profile.
ExcludeUnlimitedbool—Exclude gifts that do not have the starGift.limited flag set.
ExcludeUniquebool—Exclude collectible gifts ».
SortByValuebool—If set, sorts the gifts by price instead of reception date.
ExcludeUpgradablebool—Exclude gifts that can be upgraded to collectible gifts ».
ExcludeUnupgradablebool—Exclude gifts that cannot be upgraded to collectible gifts ».
PeerColorAvailablebool—PeerColorAvailable field of PaymentsGetSavedStarGiftsRequest.
ExcludeHostedbool—ExcludeHosted 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.
CollectionIDint—Only 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​