setBusinessAccountUsername()
Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
business_connection_id | string | required | Unique identifier of the business connection |
username | string | optional | The new value of the username for the business account; 0-32 characters |
returns
boolean
usage in yaebal
setBusinessAccountUsername is directly typed on Api — call it straight off bot.api.
import type { SetBusinessAccountUsernameParams } from "@yaebal/types";
await bot.api.setBusinessAccountUsername({
business_connection_id: "...",
} satisfies SetBusinessAccountUsernameParams);context shortcut
also available as ctx.setBusinessAccountUsername() on
4
context types — see @yaebal/contexts.
/** Changes the username of a managed business account. Requires the *can\_change\_username* business bot right. Returns *True* on success. */
ctx.setBusinessAccountUsername(params: Omit<SetBusinessAccountUsernameParams, "business_connection_id"> & { business_connection_id?: string })official Bot API docs: https://core.telegram.org/bots/api/#setbusinessaccountusername