Available methods

setBusinessAccountGiftSettings()

Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.

parameters

parametertyperequireddescription
business_connection_idstringrequiredUnique identifier of the business connection
show_gift_buttonbooleanrequiredPass True if a button for sending a gift to the user or by the business account must always be shown in the input field
accepted_gift_typesAcceptedGiftTypesrequiredTypes of gifts accepted by the business account

returns

boolean

usage in yaebal

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

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

await bot.api.setBusinessAccountGiftSettings({
  business_connection_id: "...",
  show_gift_button: true,
  accepted_gift_types: {} /* AcceptedGiftTypes */,
} satisfies SetBusinessAccountGiftSettingsParams);

context shortcut

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

context shortcut
/** Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the *can\_change\_gift\_settings* business bot right. Returns *True* on success. */
ctx.setBusinessAccountGiftSettings(params: Omit<SetBusinessAccountGiftSettingsParams, "business_connection_id"> & { business_connection_id?: string })