peyk.platforms.bale.types.poll_option

Classes

PollOption([persistent_id, text, voter_count])

Represent one option of a Bale poll.

class peyk.platforms.bale.types.poll_option.PollOption(persistent_id: str = '', text: str = '', voter_count: int = 0)[source]

Bases: object

Represent one option of a Bale poll.

The Bale documentation does not describe polls, but the live API returns them; the field set mirrors what the server sends (persistent_id is the stable option identifier, unlike the option’s position).

persistent_id: str = ''
text: str = ''
voter_count: int = 0
classmethod from_dict(data: dict | None) → PollOption | None[source]

Parse raw Bale data into PollOption.

Parameters:

data (Optional[dict]) – Raw API object or None.

Returns:

Parsed object or None.

Return type:

Optional[PollOption]

classmethod list_from_result(data: List[dict] | None) → List[PollOption] | None[source]

Parse a raw option list; None stays None.