Available methods

getManagedBotToken()

Use this method to get the token of a managed bot. Returns the token as String on success.

parameters

parametertyperequireddescription
user_idnumberrequiredUser identifier of the managed bot whose token will be returned

returns

string

usage in yaebal

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

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

await bot.api.getManagedBotToken({
  user_id: 123456789,
} satisfies GetManagedBotTokenParams);

context shortcut

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

context shortcut
/** Use this method to get the token of a managed bot. Returns the token as *String* on success. */
ctx.getManagedBotToken(params?: Omit<GetManagedBotTokenParams, "user_id"> & { user_id?: number })