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
| Name | Type | Required | Description |
|---|---|---|---|
ExcludeUnsaved | bool | — | Exclude gifts not pinned on the profile. |
ExcludeSaved | bool | — | Exclude gifts pinned on the profile. |
ExcludeUnlimited | bool | — | Exclude gifts that do not have the starGift.limited flag set. |
ExcludeUnique | bool | — | Exclude collectible gifts ». |
SortByValue | bool | — | If set, sorts the gifts by price instead of reception date. |
ExcludeUpgradable | bool | — | Exclude gifts that can be upgraded to collectible gifts ». |
ExcludeUnupgradable | bool | — | Exclude gifts that cannot be upgraded to collectible gifts ». |
PeerColorAvailable | bool | — | PeerColorAvailable field of PaymentsGetSavedStarGiftsRequest. |
ExcludeHosted | bool | — | ExcludeHosted field of PaymentsGetSavedStarGiftsRequest. |
Peer | InputPeerClass | yes | 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. |
CollectionID | int | — | Only returns gifts within the specified collection ». |
Offset | string | yes | Offset for pagination. |
Limit | int | yes | Maximum number of results to return, see pagination |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_INVALID | The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. |
| 400 | COLLECTION_ID_INVALID | |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
payments.getSavedStarGifts#a319e569