Available methods

transferBusinessAccountStars()

Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

parameters

parametertyperequireddescription
business_connection_idstringrequiredUnique identifier of the business connection
star_countnumberrequiredNumber of Telegram Stars to transfer; 1-10000

returns

boolean

usage in yaebal

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

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

await bot.api.transferBusinessAccountStars({
  business_connection_id: "...",
  star_count: 1,
} satisfies TransferBusinessAccountStarsParams);

context shortcut

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

context shortcut
/** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the *can\_transfer\_stars* business bot right. Returns *True* on success. */
ctx.transferBusinessAccountStars(params: Omit<TransferBusinessAccountStarsParams, "business_connection_id"> & { business_connection_id?: string })