Skip to content

hikari.polls#

Entities that are used to describe polls on Discord.

Poll #

Represents an existing poll.

allow_multiselect class-attribute instance-attribute #

allow_multiselect: bool = field(repr=True)

Whether a user can select multiple answers.

answers class-attribute instance-attribute #

answers: Sequence[PollAnswer] = field(repr=True)

The answers attached to the poll.

expiry class-attribute instance-attribute #

expiry: datetime | None = field(repr=True)

The expiry time for the poll.

layout_type class-attribute instance-attribute #

layout_type: PollLayoutType = field(repr=True)

The type of layout the poll uses.

question class-attribute instance-attribute #

question: PollMedia = field(repr=True)

The question of the poll.

results class-attribute instance-attribute #

results: PollResult | None = field(repr=True)

The results of the poll.

PollAnswer #

Represents an answer to a poll.

answer_id class-attribute instance-attribute #

answer_id: int = field(repr=True)

The ID that labels this answer.

poll_media class-attribute instance-attribute #

poll_media: PollMedia = field(repr=True)

The media associated with this answer.

PollAnswerCount #

Represents the count of a poll answer.

count class-attribute instance-attribute #

count: int = field(repr=True)

The number of votes for this answer.

id class-attribute instance-attribute #

id: int = field(repr=True)

The ID of the answer.

me_voted class-attribute instance-attribute #

me_voted: bool = field(repr=True)

Whether the current user voted for this answer.

PollLayoutType #

Bases: int, Enum

Layout of a poll.

DEFAULT class-attribute instance-attribute #

DEFAULT = 1

The default layout of a poll.

PollMedia #

Common object backing a poll's questions and answers.

emoji class-attribute instance-attribute #

emoji: Emoji | None = field(default=None, repr=True)

The emoji of the element, or None if not present.

text class-attribute instance-attribute #

text: str | None = field(default=None, repr=True)

The text of the element, or None if not present.

PollResult #

Represents a poll result.

answer_counts class-attribute instance-attribute #

answer_counts: Sequence[PollAnswerCount] = field(repr=True)

The counts for each answer.

is_finalized class-attribute instance-attribute #

is_finalized: bool = field(repr=True)

Whether the poll is finalized and the votes are precisely counted.