Available methods

setManagedBotAccessSettings()

Use this method to change the access settings of a managed bot. Returns True on success.

parameters

parametertyperequireddescription
user_idnumberrequiredUser identifier of the managed bot whose access settings will be changed
is_access_restrictedbooleanrequiredPass True if only selected users can access the bot. The bot's owner can always access it.
added_user_idsnumber[]optionalA JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is False.

returns

boolean

usage in yaebal

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

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

await bot.api.setManagedBotAccessSettings({
  user_id: 123456789,
  is_access_restricted: true,
} satisfies SetManagedBotAccessSettingsParams);

context shortcut

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

context shortcut
/** Use this method to change the access settings of a managed bot. Returns *True* on success. */
ctx.setManagedBotAccessSettings(params: Omit<SetManagedBotAccessSettingsParams, "user_id"> & { user_id?: number })