payments.getSavedStarGifts #

Fetch the full list of gifts » owned, received or hosted » 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.

Layer 223

payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;
---functions---
payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
exclude_unsavedflags.0?trueExclude gifts not pinned on the profile.
exclude_savedflags.1?trueExclude gifts pinned on the profile.
exclude_unlimitedflags.2?trueExclude gifts that do not have the starGift.limited flag set.
exclude_uniqueflags.4?trueExclude collectible gifts ».
sort_by_valueflags.5?trueIf set, sorts the gifts by price instead of reception date.
exclude_upgradableflags.7?trueExclude gifts that can be upgraded to collectible gifts ».
exclude_unupgradableflags.8?trueExclude gifts that cannot be upgraded to collectible gifts ».
peer_color_availableflags.9?trueIf set, only returns collectible gifts whose palette can be used as a collectible message palette ».
exclude_hostedflags.10?trueIf set, excludes hosted collectible gifts », returning only gifts owned or received by peer.
peerInputPeerFetch only gifts owned, received or hosted » 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.
collection_idflags.6?intOnly returns gifts within the specified collection ».
offsetstringOffset for pagination.
limitintMaximum number of results to return, see pagination

Result #

payments.SavedStarGifts

Both users and bots can use this method #

This method can be invoked over a business connection » #

Possible errors #

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

starGift #

Represents a star gift, see here » for more info.

Telegram Gifts #

Users can send Gifts to their friends. The recipients of gifts can display them on their profile pages or turn them into Telegram Stars ». Telegram Stars can be used for many things, including supporting creators and buying services in mini apps.

Accent colors #

Telegram users and channels can change the accent color and background pattern of their profile page and their messages!

inputPeerUser #

Defines a user for further interaction.

inputPeerChannel #

Defines a channel for further interaction.

Connected business bots #

Users can connect Telegram bots that will process and answer messages on their behalf. This allows them to seamlessly integrate any existing tools and workflows, or add AI assistants that manage their chats.

Pagination in the API #

How to fetch results from large lists of objects.

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.