Source code for pyrobale.objects.poll

from typing import TYPE_CHECKING, Optional, List, Union
from .polloption import PollOption


[docs] class Poll: def __init__( self, id: int, question: str, options: Union[List[PollOption], List], total_voter_count: int, is_closed: bool, is_anonymous: bool, type: str, allows_multiple_answers: bool, allows_revoting: bool, members_only: bool, **kwargs ):
[docs] self.id = id
[docs] self.question = question
if isinstance(options, list): self.options = [PollOption(**option) for option in options]
[docs] self.total_voter_count = total_voter_count
[docs] self.is_closed = is_closed
[docs] self.is_anonymous = is_anonymous
[docs] self.type = type
[docs] self.allows_multiple_answers = allows_multiple_answers
[docs] self.allows_revoting = allows_revoting
[docs] self.members_only = members_only