From a13726a1c0114f72e0037bad4292b4a2a6693b65 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 18 Mar 2023 06:20:32 -0500 Subject: [PATCH] Add creator_id field for Space This field has been missing documentation on https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/space --- tweepy/space.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tweepy/space.py b/tweepy/space.py index f40be52..128630c 100644 --- a/tweepy/space.py +++ b/tweepy/space.py @@ -31,6 +31,9 @@ class Space(HashableID, DataMapping): .. versionchanged:: 4.6 Added ``subscriber_count`` field + .. versionchanged:: 4.14 + Added ``creator_id`` field + Attributes ---------- data : dict @@ -76,6 +79,7 @@ class Space(HashableID, DataMapping): updated_at : datetime.datetime | None Specifies the date and time of the last update to any of the Space's metadata, such as its title or scheduled time. + creator_id : int | None References ---------- @@ -88,7 +92,7 @@ class Space(HashableID, DataMapping): "data", "id", "state", "created_at", "ended_at", "host_ids", "lang", "is_ticketed", "invited_user_ids", "participant_count", "subscriber_count", "scheduled_start", "speaker_ids", "started_at", - "title", "topic_ids", "updated_at" + "title", "topic_ids", "updated_at", "creator_id" ) def __init__(self, data): @@ -129,5 +133,9 @@ class Space(HashableID, DataMapping): if self.updated_at is not None: self.updated_at = parse_datetime(self.updated_at) + self.creator_id = data.get("creator_id") + if self.creator_id is not None: + self.creator_id = int(self.creator_id) + def __repr__(self): return f"" -- 2.25.1