Add support for exclude parameter for get_quote_tweets
authorHarmon <Harmon758@gmail.com>
Thu, 25 Aug 2022 08:10:59 +0000 (03:10 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 25 Aug 2022 08:10:59 +0000 (03:10 -0500)
This was previously undocumented for the endpoint:
https://twittercommunity.com/t/quote-tweets-api-can-use-exclude-parameter/171392

tweepy/asynchronous/client.py
tweepy/client.py

index 274f16d4401f5fc03d4a3eb144e13a413baabab8..27705a8dc2b8e6fb33b694903539a0730af63232 100644 (file)
@@ -777,6 +777,9 @@ class AsyncClient(AsyncBaseClient):
         ----------
         id : int | str
             Unique identifier of the Tweet to request.
+        exclude : list[str] | str | None
+            Comma-separated list of the types of Tweets to exclude from the
+            response.
         expansions : list[str] | str | None
             :ref:`expansions_parameter`
         max_results : int | None
@@ -816,7 +819,7 @@ class AsyncClient(AsyncBaseClient):
         return await self._make_request(
             "GET", f"/2/tweets/{id}/quote_tweets", params=params,
             endpoint_parameters=(
-                "expansions", "max_results", "media.fields",
+                "exclude", "expansions", "max_results", "media.fields",
                 "pagination_token", "place.fields", "poll.fields",
                 "tweet.fields", "user.fields"
             ), data_type=Tweet, user_auth=user_auth
index 5f25c1a5fd39f35e4c15c4914e3f17d93cc22809..aa3d34eef237940fcf68b26f19cdd28ab18ee305 100644 (file)
@@ -845,6 +845,9 @@ class Client(BaseClient):
         ----------
         id : int | str
             Unique identifier of the Tweet to request.
+        exclude : list[str] | str | None
+            Comma-separated list of the types of Tweets to exclude from the
+            response.
         expansions : list[str] | str | None
             :ref:`expansions_parameter`
         max_results : int | None
@@ -884,7 +887,7 @@ class Client(BaseClient):
         return self._make_request(
             "GET", f"/2/tweets/{id}/quote_tweets", params=params,
             endpoint_parameters=(
-                "expansions", "max_results", "media.fields",
+                "exclude", "expansions", "max_results", "media.fields",
                 "pagination_token", "place.fields", "poll.fields",
                 "tweet.fields", "user.fields"
             ), data_type=Tweet, user_auth=user_auth