diff --git a/docs/models.rst b/docs/models.rst index 71cf7f716..a40269b0e 100644 --- a/docs/models.rst +++ b/docs/models.rst @@ -88,6 +88,9 @@ Models Reference .. versionchanged:: 4.4 Added ``ended_at`` and ``topic_ids`` fields + .. versionchanged:: 4.6 + Added ``subscriber_count`` field + :reference: https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/space .. class:: tweepy.Tweet diff --git a/tweepy/space.py b/tweepy/space.py index 2762d6ced..73c8a3879 100644 --- a/tweepy/space.py +++ b/tweepy/space.py @@ -11,8 +11,8 @@ class Space(HashableID, DataMapping): __slots__ = ( "data", "id", "state", "created_at", "ended_at", "host_ids", "lang", "is_ticketed", "invited_user_ids", "participant_count", - "scheduled_start", "speaker_ids", "started_at", "title", "topic_ids", - "updated_at" + "scheduled_start", "speaker_ids", "started_at", "subscriber_count", + "title", "topic_ids", "updated_at" ) def __init__(self, data): @@ -44,6 +44,9 @@ def __init__(self, data): if self.started_at is not None: self.started_at = parse_datetime(self.started_at) + # https://twittercommunity.com/t/missing-documentation-for-new-space-object-subscriber-count-field-on-space-object-page/166943 + self.subscriber_count = data.get("subscriber_count") + self.title = data.get("title") self.topic_ids = data.get("topic_ids", [])