Class TdApi.InputMessagePoll

Enclosing class:
TdApi

public static class TdApi.InputMessagePoll extends TdApi.InputMessageContent
A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    True, if multiple answer options can be chosen simultaneously.
    boolean
    True, if the poll can be answered multiple times.
    int
    Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified.
    static final int
    Identifier uniquely determining type of the object.
    The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote; for channel chats only.
    Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters.
    boolean
    True, if the poll results will appear only after the poll closes.
    boolean
    True, if the poll voters are anonymous.
    boolean
    True, if the poll needs to be sent already closed; for bots only.
    Media attached to the poll; pass null if none.
    boolean
    True, if only the users that are members of the chat for more than a day will be able to vote; for channel chats only.
    int
    Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified.
    List of poll answer options; 1-getOption("poll_answer_count_max") options.
    Poll question; 1-255 characters (up to 300 characters for bots).
    boolean
    True, if poll options must be shown in a fixed random order.
    Type of the poll.
  • Constructor Summary

    Constructors
    Constructor
    Description
    A message with a poll.
    InputMessagePoll(TdApi.FormattedText question, TdApi.InputPollOption[] options, TdApi.FormattedText description, TdApi.InputPollMedia media, boolean isAnonymous, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, String[] countryCodes, boolean shuffleOptions, boolean hideResultsUntilCloses, TdApi.InputPollType type, int openPeriod, int closeDate, boolean isClosed)
    A message with a poll.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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

    • question

      public TdApi.FormattedText question
      Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users.
    • options

      public TdApi.InputPollOption[] options
      List of poll answer options; 1-getOption("poll_answer_count_max") options.
    • description

      public TdApi.FormattedText description
      Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters.
    • media

      public TdApi.InputPollMedia media
      Media attached to the poll; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption.
    • isAnonymous

      public boolean isAnonymous
      True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels.
    • 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; for channel chats only.
    • 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; for channel chats only. If empty, then all users can participate in the poll. There can be up to getOption("poll_country_count_max") chosen countries.
    • shuffleOptions

      public boolean shuffleOptions
      True, if poll options must be shown in a fixed random order.
    • hideResultsUntilCloses

      public boolean hideResultsUntilCloses
      True, if the poll results will appear only after the poll closes.
    • type

      public TdApi.InputPollType type
      Type of the poll.
    • openPeriod

      public int openPeriod
      Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified.
    • closeDate

      public int closeDate
      Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified.
    • isClosed

      public boolean isClosed
      True, if the poll needs to be sent already closed; for bots only.
    • CONSTRUCTOR

      public static final int CONSTRUCTOR
      Identifier uniquely determining type of the object.
      See Also:
  • Constructor Details

    • InputMessagePoll

      public InputMessagePoll()
      A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat.
    • InputMessagePoll

      public InputMessagePoll(TdApi.FormattedText question, TdApi.InputPollOption[] options, TdApi.FormattedText description, TdApi.InputPollMedia media, boolean isAnonymous, boolean allowsMultipleAnswers, boolean allowsRevoting, boolean membersOnly, String[] countryCodes, boolean shuffleOptions, boolean hideResultsUntilCloses, TdApi.InputPollType type, int openPeriod, int closeDate, boolean isClosed)
      A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat.
      Parameters:
      question - Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users.
      options - List of poll answer options; 1-getOption("poll_answer_count_max") options.
      description - Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters.
      media - Media attached to the poll; pass null if none. Must be one of the following types: inputPollMediaAnimation, inputPollMediaAudio, inputPollMediaDocument, inputPollMediaLocation, inputPollMediaPhoto, inputPollMediaVenue, or inputPollMediaVideo without caption.
      isAnonymous - True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels.
      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; for channel chats only.
      countryCodes - The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote; for channel chats only. If empty, then all users can participate in the poll. There can be up to getOption("poll_country_count_max") chosen countries.
      shuffleOptions - True, if poll options must be shown in a fixed random order.
      hideResultsUntilCloses - True, if the poll results will appear only after the poll closes.
      type - Type of the poll.
      openPeriod - Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified.
      closeDate - Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified.
      isClosed - True, if the poll needs to be sent already closed; for bots only.
  • 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