Airgram

Guides
/
/
Methods

api.answerCallbackQuery()

Sets the result of a callback query; for bots only

Parameters AnswerCallbackQueryParams:

NameTypeDescription
callbackQueryIdstring Identifier of the callback query
textstring Text of the answer
showAlertboolean If true, an alert must be shown to the user instead of a toast notification
urlstring URL to be opened
cacheTimenumber Time during which the result of the query can be cached, in seconds
Returns ApiResponse interface:
interface ApiResponse {
  _: 'answerCallbackQuery' | 'error'
  airgram: Airgram
  request: {
    method: 'answerCallbackQuery'
    params: AnswerCallbackQueryParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}