savePreparedKeyboardButton()
Stores a keyboard button that can be used by a user within a Mini App. Returns a PreparedKeyboardButton object.
parameters
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | Unique identifier of the target user that can use the button |
button | KeyboardButton | required | A JSON-serialized object describing the button to be saved. The button must be of the type request_users, request_chat, or request_managed_bot. |
returns
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { PreparedKeyboardButton, SavePreparedKeyboardButtonParams } from "@yaebal/types";
await bot.api.call<PreparedKeyboardButton>("savePreparedKeyboardButton", {
user_id: 123456789,
button: {} /* KeyboardButton */,
} satisfies SavePreparedKeyboardButtonParams);context shortcut
also available as ctx.savePreparedKeyboardButton() on
16
context types — see @yaebal/contexts.
/** Stores a keyboard button that can be used by a user within a Mini App. Returns a [PreparedKeyboardButton](https://core.telegram.org/bots/api/#preparedkeyboardbutton) object. */
ctx.savePreparedKeyboardButton(params: Omit<SavePreparedKeyboardButtonParams, "user_id">)official Bot API docs: https://core.telegram.org/bots/api/#savepreparedkeyboardbutton