Available methods

setBusinessAccountName()

Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.

parameters

parametertyperequireddescription
business_connection_idstringrequiredUnique identifier of the business connection
first_namestringrequiredThe new value of the first name for the business account; 1-64 characters
last_namestringoptionalThe new value of the last name for the business account; 0-64 characters

returns

boolean

usage in yaebal

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

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

await bot.api.setBusinessAccountName({
  business_connection_id: "...",
  first_name: "...",
} satisfies SetBusinessAccountNameParams);

context shortcut

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

context shortcut
/** Changes the first and last name of a managed business account. Requires the *can\_change\_name* business bot right. Returns *True* on success. */
ctx.setBusinessAccountName(params: Omit<SetBusinessAccountNameParams, "business_connection_id"> & { business_connection_id?: string })