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
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | User 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.
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.
/** 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 })official Bot API docs: https://core.telegram.org/bots/api/#replacemanagedbottoken