Available methods

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

parametertyperequireddescription
business_connection_idstringrequiredUnique identifier of the business connection
owned_gift_idstringrequiredUnique identifier of the regular gift that should be upgraded to a unique one
keep_original_detailsbooleanoptionalPass True to keep the original gift text, sender and receiver in the upgraded gift
star_countnumberoptionalThe 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

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { UpgradeGiftParams } from "@yaebal/types";

await bot.api.call<boolean>("upgradeGift", {
  business_connection_id: "...",
  owned_gift_id: "...",
} satisfies UpgradeGiftParams);