upgradeGift()
Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
business_connection_id | string | required | Unique identifier of the business connection |
owned_gift_id | string | required | Unique identifier of the regular gift that should be upgraded to a unique one |
keep_original_details | boolean | optional | Pass True to keep the original gift text, sender and receiver in the upgraded gift |
star_count | number | optional | The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. |
returns
boolean
usage in yaebal
upgradeGift is directly typed on Api — call it straight off bot.api.
import type { UpgradeGiftParams } from "@yaebal/types";
await bot.api.upgradeGift({
business_connection_id: "...",
owned_gift_id: "...",
} satisfies UpgradeGiftParams);context shortcut
also available as ctx.upgradeGift() on
4
context types — see @yaebal/contexts.
/** Upgrades a given regular gift to a unique gift. Requires the *can\_transfer\_and\_upgrade\_gifts* business bot right. Additionally requires the *can\_transfer\_stars* business bot right if the upgrade is paid. Returns *True* on success. */
ctx.upgradeGift(params: Omit<UpgradeGiftParams, "business_connection_id"> & { business_connection_id?: string })official Bot API docs: https://core.telegram.org/bots/api/#upgradegift