peyk.platforms.bale.types.poll

Classes

Poll([id, question, options, ...])

Represent a Bale poll (undocumented, but present in the live API).

class peyk.platforms.bale.types.poll.Poll(id: Any = None, question: str = '', options: List[PollOption] | None = None, total_voter_count: int = 0, is_closed: bool = False, is_anonymous: bool = True, type: str = '', allows_multiple_answers: bool = False, allows_revoting: bool = False, members_only: bool = False)[source]

Bases: object

Represent a Bale poll (undocumented, but present in the live API).

A poll arrives either inside Message.poll or on its own as the poll field of an Update. The field set mirrors what the server sends.

id: Any = None
question: str = ''
options: List[PollOption] | None = None
total_voter_count: int = 0
is_closed: bool = False
is_anonymous: bool = True
type: str = ''
allows_multiple_answers: bool = False
allows_revoting: bool = False
members_only: bool = False
classmethod from_dict(data: dict | None) → Poll | None[source]

Parse raw Bale data into Poll.

Parameters:

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

Returns:

Parsed object or None.

Return type:

Optional[Poll]