Inline mode

answerInlineQuery()

Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.

parameters

parametertyperequireddescription
inline_query_idstringrequiredUnique identifier for the answered query
resultsInlineQueryResult[]requiredA JSON-serialized array of results for the inline query
cache_timenumberoptionalThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalbooleanoptionalPass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query.
next_offsetstringoptionalPass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.
buttonInlineQueryResultsButtonoptionalA JSON-serialized object describing a button to be shown above inline query results

returns

boolean

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 { AnswerInlineQueryParams } from "@yaebal/types";

await bot.api.call<boolean>("answerInlineQuery", {
  inline_query_id: "...",
  results: [],
} satisfies AnswerInlineQueryParams);

context shortcut

also available as ctx.answer() on 1 context type — see @yaebal/contexts.

context shortcut
/** Use this method to send answers to an inline query. On success, *True* is returned. No more than **50** results per query are allowed. */
ctx.answer(params: Omit<AnswerInlineQueryParams, "inline_query_id">)