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

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

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

await bot.api.call<PreparedInlineMessage>("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">)