Layer 220
PaymentsUpgradeStarGift
Upgrade a gift to a collectible gift: can only be used if the upgrade was already paid by the gift sender; see here for more info on the full flow (including the different flow to use in case the upgrade was not paid by the gift sender).
method
Users
Business
payments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| KeepOriginalDetails | flags.0?true | Set this flag to keep the original gift text, sender and receiver in the upgraded gift as a star Gift Attribute Original Details attribute. |
| Stargift | InputSavedStarGift | The gift to upgrade |
Returns
UpdatesPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_INVALID | The connection_id passed to the wrapping invoke With Business Connection call is invalid. |
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | PAYMENT_REQUIRED | Payment is required for this action, see here for more info. |
| 400 | SAVED_ID_EMPTY | The passed input Saved Star Gift Chat. saved_id is empty. |
| 400 | STARGIFT_ALREADY_CONVERTED | The specified star gift was already converted to Stars. |
| 400 | STARGIFT_ALREADY_UPGRADED | The specified gift was already upgraded to a collectible gift. |
| 400 | STARGIFT_UPGRADE_UNAVAILABLE | A received gift can only be upgraded to a collectible gift if the message Action Star Gift / saved Star Gift. can_upgrade flag is set. |
Gogram Example
// PaymentsUpgradeStarGift - using Params struct result, err := client.PaymentsUpgradeStarGift(&tg.PaymentsUpgradeStarGiftParams{ Stargift: &tg.InputSavedStarGift{}, // Optional fields: // KeepOriginalDetails: true, }) if err != nil { // handle error } // result is *tg.Updates