Available methods

savePreparedInlineMessage()

Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.

parameters

parametertyperequireddescription
user_idnumberrequiredUnique identifier of the target user that can use the prepared message
resultInlineQueryResultrequiredA JSON-serialized object describing the message to be sent
allow_user_chatsbooleanoptionalPass True if the message can be sent to private chats with users
allow_bot_chatsbooleanoptionalPass True if the message can be sent to private chats with bots
allow_group_chatsbooleanoptionalPass True if the message can be sent to group and supergroup chats
allow_channel_chatsbooleanoptionalPass True if the message can be sent to channel chats

returns

PreparedInlineMessage

usage in yaebal

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

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

await bot.api.savePreparedInlineMessage({
  user_id: 123456789,
  result: {} /* InlineQueryResult */,
} satisfies SavePreparedInlineMessageParams);

context shortcut

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

context shortcut
/** Stores a message that can be sent by a user of a Mini App. Returns a [PreparedInlineMessage](https://core.telegram.org/bots/api/#preparedinlinemessage) object. */
ctx.savePreparedInlineMessage(params: Omit<SavePreparedInlineMessageParams, "user_id"> & { user_id?: number })