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

Inherits Object.

Description

Describes one answer option of a poll.

Public Member Functions

 pollOption ()
 pollOption (string const &id_, object_ptr< formattedText > &&text_, object_ptr< PollMedia > &&media_, int32 voter_count_, int32 vote_percentage_, array< object_ptr< MessageSender > > &&recent_voter_ids_, bool is_chosen_, bool is_being_chosen_, object_ptr< MessageSender > &&author_, int32 addition_date_)
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

int32 addition_date_
 Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll.
object_ptr< MessageSender > author_
 Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll.
string id_
 Unique identifier of the option in the poll; may be empty if yet unassigned.
bool is_being_chosen_
 True, if the option is being chosen by a pending setPollAnswer request.
bool is_chosen_
 True, if the option was chosen by the user.
object_ptr< PollMedia > media_
 Option media; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaLink, pollMediaLocation, pollMediaPhoto, pollMediaSticker, pollMediaVenue, or pollMediaVideo.
array< object_ptr< MessageSender > > recent_voter_ids_
 Identifiers of recent voters for the option, if the poll is non-anonymous and poll results are available.
object_ptr< formattedText > text_
 Option text; 1-100 characters; may contain only custom emoji entities.
int32 vote_percentage_
 The percentage of votes for this option; 0-100.
int32 voter_count_
 Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll.

Static Public Attributes

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

Constructor & Destructor Documentation

◆ pollOption() [1/2]

pollOption ( )

Describes one answer option of a poll.

◆ pollOption() [2/2]

pollOption ( string const & id_,
object_ptr< formattedText > && text_,
object_ptr< PollMedia > && media_,
int32 voter_count_,
int32 vote_percentage_,
array< object_ptr< MessageSender > > && recent_voter_ids_,
bool is_chosen_,
bool is_being_chosen_,
object_ptr< MessageSender > && author_,
int32 addition_date_ )

Describes one answer option of a poll.

Parameters
[in]id_Unique identifier of the option in the poll; may be empty if yet unassigned.
[in]text_Option text; 1-100 characters; may contain only custom emoji entities.
[in]media_Option media; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaLink, pollMediaLocation, pollMediaPhoto, pollMediaSticker, pollMediaVenue, or pollMediaVideo.
[in]voter_count_Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll.
[in]vote_percentage_The percentage of votes for this option; 0-100.
[in]recent_voter_ids_Identifiers of recent voters for the option, if the poll is non-anonymous and poll results are available.
[in]is_chosen_True, if the option was chosen by the user.
[in]is_being_chosen_True, if the option is being chosen by a pending setPollAnswer request.
[in]author_Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll.
[in]addition_date_Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of 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: