Link Search Menu Expand Document

Constructor: starGift

Back to constructors index

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

Attributes:

NameTypeRequiredDescription
limitedBoolOptionalWhether this is a limited-supply gift.
sold_outBoolOptionalWhether this gift sold out and cannot be bought anymore.
birthdayBoolOptionalWhether this is a birthday-themed gift
require_premiumBoolOptionalThis gift can only be bought by users with a Premium subscription.
limited_per_userBoolOptionalIf set, the maximum number of gifts of this type that can be owned by a single user is limited and specified in per_user_total, and the remaining slots for the current user in per_user_remains.
peer_color_availableBoolOptional
idlongYesIdentifier of the gift
stickerDocumentOptionalSticker that represents the gift.
starslongYesPrice of the gift in Telegram Stars.
availability_remainsintOptionalFor limited-supply gifts: the remaining number of gifts that may be bought.
availability_totalintOptionalFor limited-supply gifts: the total number of gifts that was available in the initial supply.
availability_resalelongOptionalThe total number of (upgraded to collectibles) gifts of this type currently on resale
convert_starslongYesThe receiver of this gift may convert it to this many Telegram Stars, instead of displaying it on their profile page.
convert_stars will be equal to stars only if the gift was bought using recently bought Telegram Stars, otherwise it will be less than stars.
first_sale_dateintOptionalFor sold out gifts only: when was the gift first bought.
last_sale_dateintOptionalFor sold out gifts only: when was the gift last bought.
upgrade_starslongOptionalThe number of Telegram Stars the user can pay to convert the gift into a collectible gift ».
resell_min_starslongOptionalThe minimum price in Stars for gifts of this type currently on resale.
titlestringOptionalTitle of the gift
released_byPeerOptionalThis gift was released by the specified peer.
per_user_totalintOptionalMaximum number of gifts of this type that can be owned by any user.
per_user_remainsintOptionalRemaining number of gifts of this type that can be owned by the current user.
locked_until_dateintOptionalIf set, the specified gift possibly cannot be sent until the specified date, see here » for the full flow.

Type: StarGift

Example:

$starGift = ['_' => 'starGift', 'limited' => Bool, 'sold_out' => Bool, 'birthday' => Bool, 'require_premium' => Bool, 'limited_per_user' => Bool, 'peer_color_available' => Bool, 'id' => long, 'sticker' => Document, 'stars' => long, 'availability_remains' => int, 'availability_total' => int, 'availability_resale' => long, 'convert_stars' => long, 'first_sale_date' => int, 'last_sale_date' => int, 'upgrade_stars' => long, 'resell_min_stars' => long, 'title' => 'string', 'released_by' => Peer, 'per_user_total' => int, 'per_user_remains' => int, 'locked_until_date' => int];