Add verified_type field for User
authorHarmon <Harmon758@gmail.com>
Wed, 1 Mar 2023 01:13:05 +0000 (19:13 -0600)
committerHarmon <Harmon758@gmail.com>
Wed, 1 Mar 2023 01:13:05 +0000 (19:13 -0600)
tweepy/user.py

index f5a52a55b0bd3f456a214e99156a7fc749846203..2ebceca9ca4162bd1ae831863fb2d15eec8e1621 100644 (file)
@@ -21,6 +21,9 @@ class User(HashableID, DataMapping):
 
     .. versionadded:: 4.0
 
+    .. versionchanged:: 4.13
+        Added ``verified_type`` field
+
     Attributes
     ----------
     data : dict
@@ -63,6 +66,9 @@ class User(HashableID, DataMapping):
         The URL specified in the user's profile, if present.
     verified : bool | None
         Indicates if this user is a verified Twitter User.
+    verified_type : str | None
+        Indicates the type of verification a user account has (blue, business,
+        government or none).
     withheld : dict | None
         Contains withholding details for `withheld content`_, if applicable.
 
@@ -77,7 +83,8 @@ class User(HashableID, DataMapping):
     __slots__ = (
         "data", "id", "name", "username", "created_at", "description",
         "entities", "location", "pinned_tweet_id", "profile_image_url",
-        "protected", "public_metrics", "url", "verified", "withheld"
+        "protected", "public_metrics", "url", "verified", "verified_type",
+        "withheld"
     )
 
     def __init__(self, data):
@@ -103,6 +110,7 @@ class User(HashableID, DataMapping):
         self.public_metrics = data.get("public_metrics")
         self.url = data.get("url")
         self.verified = data.get("verified")
+        self.verified_type = data.get("verified_type")
         self.withheld = data.get("withheld")
 
     def __repr__(self):