Airgram

Guides
/
/
Methods

api.answerInlineQuery()

Sets the result of an inline query; for bots only

Parameters AnswerInlineQueryParams:

NameTypeDescription
inlineQueryIdstring Identifier of the inline query
isPersonalboolean True, if the result of the query can be cached for the specified user
results The results of the query
cacheTimenumber Allowed time to cache the results of the query, in seconds
nextOffsetstring Offset for the next inline query; pass an empty string if there are no more results
switchPmTextstring If non-empty, this text must be shown on the button that opens a private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter
switchPmParameterstring The parameter for the bot start message
Returns ApiResponse interface:
interface ApiResponse {
  _: 'answerInlineQuery' | 'error'
  airgram: Airgram
  request: {
    method: 'answerInlineQuery'
    params: AnswerInlineQueryParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}