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

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

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

await bot.api.call<boolean>("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">)