Airgram

Guides
/
/
Methods

api.setPollAnswer()

Changes the user answer to a poll. A poll in quiz mode can be answered only once

Parameters SetPollAnswerParams:

NameTypeDescription
chatIdnumber Identifier of the chat to which the poll belongs
messageIdnumber Identifier of the message containing the poll
optionIdsnumber[] 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers
Returns ApiResponse interface:
interface ApiResponse {
  _: 'setPollAnswer' | 'error'
  airgram: Airgram
  request: {
    method: 'setPollAnswer'
    params: SetPollAnswerParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}