Add missing attributes to Poll and PollOption __init__

This commit is contained in:
Mads Marquart
2019-03-07 19:58:24 +01:00
parent 0578ea2c3c
commit c28ca58537

View File

@@ -8,14 +8,14 @@ import attr
class Poll(object): class Poll(object):
"""Represents a poll""" """Represents a poll"""
#: ID of the poll
uid = attr.ib(None, init=False)
#: Title of the poll #: Title of the poll
title = attr.ib() title = attr.ib()
#: List of :class:`PollOption`, can be fetched with :func:`fbchat.Client.fetchPollOptions` #: List of :class:`PollOption`, can be fetched with :func:`fbchat.Client.fetchPollOptions`
options = attr.ib() options = attr.ib()
#: Options count #: Options count
options_count = attr.ib(None, init=False) options_count = attr.ib(None)
#: ID of the poll
uid = attr.ib(None)
@classmethod @classmethod
def _from_graphql(cls, data): def _from_graphql(cls, data):
@@ -31,16 +31,16 @@ class Poll(object):
class PollOption(object): class PollOption(object):
"""Represents a poll option""" """Represents a poll option"""
#: ID of the poll option
uid = attr.ib(None, init=False)
#: Text of the poll option #: Text of the poll option
text = attr.ib() text = attr.ib()
#: Whether vote when creating or client voted #: Whether vote when creating or client voted
vote = attr.ib(False) vote = attr.ib(False)
#: ID of the users who voted for this poll option #: ID of the users who voted for this poll option
voters = attr.ib(None, init=False) voters = attr.ib(None)
#: Votes count #: Votes count
votes_count = attr.ib(None, init=False) votes_count = attr.ib(None)
#: ID of the poll option
uid = attr.ib(None)
@classmethod @classmethod
def _from_graphql(cls, data): def _from_graphql(cls, data):