Available methods

replaceManagedBotToken()

Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.

parameters

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

returns

string

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 { ReplaceManagedBotTokenParams } from "@yaebal/types";

await bot.api.call<string>("replaceManagedBotToken", {
  user_id: 123456789,
} satisfies ReplaceManagedBotTokenParams);

context shortcut

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

context shortcut
/** Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as *String* on success. */
ctx.replaceManagedBotToken(params?: Omit<ReplaceManagedBotTokenParams, "user_id">)