convertGiftToStars()
Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. 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 converted to Telegram Stars |
returns
boolean
usage in yaebal
convertGiftToStars is directly typed on Api — call it straight off bot.api.
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.
/** 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 })official Bot API docs: https://core.telegram.org/bots/api/#convertgifttostars