Available methods

convertGiftToStars()

Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. 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 converted to Telegram Stars

returns

boolean

usage in yaebal

convertGiftToStars is directly typed on Api — call it straight off bot.api.

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

await bot.api.convertGiftToStars({
  business_connection_id: "...",
  owned_gift_id: "...",
} satisfies ConvertGiftToStarsParams);

context shortcut

also available as ctx.convertGiftToStars() on 4 context types — see @yaebal/contexts.

context shortcut
/** Converts a given regular gift to Telegram Stars. Requires the *can\_convert\_gifts\_to\_stars* business bot right. Returns *True* on success. */
ctx.convertGiftToStars(params: Omit<ConvertGiftToStarsParams, "business_connection_id"> & { business_connection_id?: string })