Package org.drinkless.tdlib

# Class TdApi.Poll

java.lang.Object
org.drinkless.tdlib.TdApi.Object
org.drinkless.tdlib.TdApi.Poll

Enclosing class:
  `TdApi`

public static class TdApi.Poll extends TdApi.Object
Describes a poll.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `allowsMultipleAnswers`
  True, if multiple answer options can be chosen simultaneously.
  `boolean`
  `allowsRevoting`
  True, if the poll can be answered multiple times.
  `boolean`
  `canGetVoters`
  True, if the current user can get voters in the poll using getPollVoters.
  `int`
  `closeDate`
  Point in time (Unix timestamp) when the poll will automatically be closed.
  `static final int`
  `CONSTRUCTOR`
  Identifier uniquely determining type of the object.
  `String[]`
  `countryCodes`
  The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote.
  `long`
  `id`
  Unique poll identifier.
  `boolean`
  `isAnonymous`
  True, if the poll is anonymous.
  `boolean`
  `isClosed`
  True, if the poll is closed.
  `boolean`
  `membersOnly`
  True, if only the users that are members of the chat for more than a day will be able to vote.
  `int`
  `openPeriod`
  Amount of time the poll will be active after creation, in seconds.
  `int[]`
  `optionOrder`
  The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed.
  `TdApi.PollOption[]`
  `options`
  List of poll answer options.
  `TdApi.FormattedText`
  `question`
  Poll question; 1-300 characters; may contain only custom emoji entities.
  `TdApi.MessageSender[]`
  `recentVoterIds`
  Identifiers of recent voters, if the poll is non-anonymous and poll results are available.
  `int`
  `totalVoterCount`
  Total number of voters, participating in the poll.
  `TdApi.PollType`
  `type`
  Type of the poll.
  `TdApi.PollVoteRestrictionReason`
  `voteRestrictionReason`
  The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Poll()`
  Describes a poll.
  `Poll(long id, TdApi.FormattedText question, TdApi.PollOption[] options, int totalVoterCount, TdApi.MessageSender[] recentVoterIds, boolean canGetVoters, boolean isAnonymous, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, String[] countryCodes, int[] optionOrder, TdApi.PollType type, int openPeriod, int closeDate, boolean isClosed, TdApi.PollVoteRestrictionReason voteRestrictionReason)`
  Describes a poll.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getConstructor()`
  Returns an identifier uniquely determining type of the object.

  ### Methods inherited from class org.drinkless.tdlib.TdApi.Object

  `toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### id

    public long id
    Unique poll identifier.

  - ### question

    public TdApi.FormattedText question
    Poll question; 1-300 characters; may contain only custom emoji entities.

  - ### options

    public TdApi.PollOption[] options
    List of poll answer options.

  - ### totalVoterCount

    public int totalVoterCount
    Total number of voters, participating in the poll.

  - ### recentVoterIds

    public TdApi.MessageSender[] recentVoterIds
    Identifiers of recent voters, if the poll is non-anonymous and poll results are available.

  - ### canGetVoters

    public boolean canGetVoters
    True, if the current user can get voters in the poll using getPollVoters.

  - ### isAnonymous

    public boolean isAnonymous
    True, if the poll is anonymous.

  - ### allowsMultipleAnswers

    public boolean allowsMultipleAnswers
    True, if multiple answer options can be chosen simultaneously.

  - ### allowsRevoting

    public boolean allowsRevoting
    True, if the poll can be answered multiple times.

  - ### membersOnly

    public boolean membersOnly
    True, if only the users that are members of the chat for more than a day will be able to vote.

  - ### countryCodes

    public String[] countryCodes
    The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll.

  - ### optionOrder

    public int[] optionOrder
    The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed.

  - ### type

    public TdApi.PollType type
    Type of the poll.

  - ### openPeriod

    public int openPeriod
    Amount of time the poll will be active after creation, in seconds.

  - ### closeDate

    public int closeDate
    Point in time (Unix timestamp) when the poll will automatically be closed.

  - ### isClosed

    public boolean isClosed
    True, if the poll is closed.

  - ### voteRestrictionReason

    @Nullable public TdApi.PollVoteRestrictionReason voteRestrictionReason
    The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll.

  - ### CONSTRUCTOR

    public static final int CONSTRUCTOR
    Identifier uniquely determining type of the object.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Poll

    public Poll()
    Describes a poll.

  - ### Poll

    public Poll(long id, TdApi.FormattedText question, TdApi.PollOption[] options, int totalVoterCount, TdApi.MessageSender[] recentVoterIds, boolean canGetVoters, boolean isAnonymous, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, String[] countryCodes, int[] optionOrder, TdApi.PollType type, int openPeriod, int closeDate, boolean isClosed, TdApi.PollVoteRestrictionReason voteRestrictionReason)
    Describes a poll.
    Parameters:
      `id` - Unique poll identifier.
      `question` - Poll question; 1-300 characters; may contain only custom emoji entities.
      `options` - List of poll answer options.
      `totalVoterCount` - Total number of voters, participating in the poll.
      `recentVoterIds` - Identifiers of recent voters, if the poll is non-anonymous and poll results are available.
      `canGetVoters` - True, if the current user can get voters in the poll using getPollVoters.
      `isAnonymous` - True, if the poll is anonymous.
      `allowsMultipleAnswers` - True, if multiple answer options can be chosen simultaneously.
      `allowsRevoting` - True, if the poll can be answered multiple times.
      `membersOnly` - True, if only the users that are members of the chat for more than a day will be able to vote.
      `countryCodes` - The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll.
      `optionOrder` - The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed.
      `type` - Type of the poll.
      `openPeriod` - Amount of time the poll will be active after creation, in seconds.
      `closeDate` - Point in time (Unix timestamp) when the poll will automatically be closed.
      `isClosed` - True, if the poll is closed.
      `voteRestrictionReason` - The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll.

- ## Method Details

  - ### getConstructor

    public int getConstructor()
    Description copied from class: `TdApi.Object`
    Returns an identifier uniquely determining type of the object.
    Specified by:
      `getConstructor` in class `TdApi.Object`
    Returns:
      this.CONSTRUCTOR