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

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

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

await bot.api.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"> & { user_id?: number })