Some user has voted in a public poll.

Bots only receive new votes in polls that were sent by this bot.

Constructors

Properties

Accessors

Constructors

Properties

_peers: PeersIndex

Accessors

  • get chosen(): readonly Uint8Array[]
  • Answers that the user has chosen.

    Note that due to incredible Telegram APIs, you have to have the poll cached to be able to properly tell which answers were chosen, since in the API there are just arbitrary Buffers, which are defined by the client.

    However, most of the major implementations (tested with TDLib and Bot API, official apps for Android, Desktop, iOS/macOS) and mtcute (by default) create option as a one-byte Buffer, incrementing from 48 (ASCII 0) up to 57 (ASCII 9), and ASCII representation would define index in the array. Meaning, if chosen[0][0] === 48 or chosen[0].toString() === '0', then the first answer (indexed with 0) was chosen. To get the index, you simply subtract 48 from the first byte.

    This might break at any time, but seems to be consistent for now. To get chosen answer indexes derived as before, use chosenIndexesAuto.

    Returns readonly Uint8Array[]