TDLib
Loading...
Searching...
No Matches
poll Class Referencefinal

Inherits Object.

Description

Describes a poll.

Public Member Functions

 poll ()
 poll (int64 id_, object_ptr< formattedText > &&question_, array< object_ptr< pollOption > > &&options_, int32 total_voter_count_, array< object_ptr< MessageSender > > &&recent_voter_ids_, bool can_get_voters_, bool can_see_results_, bool is_anonymous_, bool allows_multiple_answers_, bool allows_revoting_, bool members_only_, array< string > &&country_codes_, array< int32 > &&option_order_, object_ptr< PollType > &&type_, int32 open_period_, int32 close_date_, bool is_closed_, object_ptr< PollVoteRestrictionReason > &&vote_restriction_reason_)
void store (TlStorerToString &s, const char *field_name) const final
Public Member Functions inherited from TlObject
TlObject & operator= (const TlObject &)=delete
TlObject & operator= (TlObject &&)=default
virtual void store (TlStorerCalcLength &s) const
virtual void store (TlStorerUnsafe &s) const
 TlObject ()=default
 TlObject (const TlObject &)=delete
 TlObject (TlObject &&)=default
virtual ~TlObject ()=default

Public Attributes

bool allows_multiple_answers_
 True, if multiple answer options can be chosen simultaneously.
bool allows_revoting_
 True, if the poll can be answered multiple times.
bool can_get_voters_
 True, if the current user can get voters in the poll using getPollVoters.
bool can_see_results_
 True, if the current user can see results of the poll.
int32 close_date_
 Point in time (Unix timestamp) when the poll will automatically be closed.
array< string > country_codes_
 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.
int64 id_
 Unique poll identifier.
bool is_anonymous_
 True, if the poll is anonymous.
bool is_closed_
 True, if the poll is closed.
bool members_only_
 True, if only the users that are members of the chat for more than a day will be able to vote.
int32 open_period_
 Amount of time the poll will be active after creation, in seconds.
array< int32 > option_order_
 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.
array< object_ptr< pollOption > > options_
 List of poll answer options.
object_ptr< formattedText > question_
 Poll question; 1-300 characters; may contain only custom emoji entities.
array< object_ptr< MessageSender > > recent_voter_ids_
 Identifiers of recent voters, if the poll is non-anonymous and poll results are available.
int32 total_voter_count_
 Total number of voters, participating in the poll.
object_ptr< PollType > type_
 Type of the poll.
object_ptr< PollVoteRestrictionReason > vote_restriction_reason_
 The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll.

Static Public Attributes

static const std::int32_t ID = -1926406506
 Identifier uniquely determining a type of the object.

Constructor & Destructor Documentation

◆ poll() [1/2]

poll ( )

Describes a poll.

◆ poll() [2/2]

poll ( int64 id_,
object_ptr< formattedText > && question_,
array< object_ptr< pollOption > > && options_,
int32 total_voter_count_,
array< object_ptr< MessageSender > > && recent_voter_ids_,
bool can_get_voters_,
bool can_see_results_,
bool is_anonymous_,
bool allows_multiple_answers_,
bool allows_revoting_,
bool members_only_,
array< string > && country_codes_,
array< int32 > && option_order_,
object_ptr< PollType > && type_,
int32 open_period_,
int32 close_date_,
bool is_closed_,
object_ptr< PollVoteRestrictionReason > && vote_restriction_reason_ )

Describes a poll.

Parameters
[in]id_Unique poll identifier.
[in]question_Poll question; 1-300 characters; may contain only custom emoji entities.
[in]options_List of poll answer options.
[in]total_voter_count_Total number of voters, participating in the poll.
[in]recent_voter_ids_Identifiers of recent voters, if the poll is non-anonymous and poll results are available.
[in]can_get_voters_True, if the current user can get voters in the poll using getPollVoters.
[in]can_see_results_True, if the current user can see results of the poll.
[in]is_anonymous_True, if the poll is anonymous.
[in]allows_multiple_answers_True, if multiple answer options can be chosen simultaneously.
[in]allows_revoting_True, if the poll can be answered multiple times.
[in]members_only_True, if only the users that are members of the chat for more than a day will be able to vote.
[in]country_codes_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.
[in]option_order_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.
[in]type_Type of the poll.
[in]open_period_Amount of time the poll will be active after creation, in seconds.
[in]close_date_Point in time (Unix timestamp) when the poll will automatically be closed.
[in]is_closed_True, if the poll is closed.
[in]vote_restriction_reason_The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll.

Member Function Documentation

◆ store()

void store ( TlStorerToString & s,
const char * field_name ) const
finalvirtual

Helper function for to_string method. Appends string representation of the object to the storer.

Parameters
[in]sStorer to which object string representation will be appended.
[in]field_nameObject field_name if applicable.

Implements TlObject.


The documentation for this class was generated from the following file: