From 4f28bd85d85adf0fb735a3e24b45e7804c534aa7 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 25 Aug 2022 03:10:59 -0500 Subject: [PATCH] Add support for exclude parameter for get_quote_tweets This was previously undocumented for the endpoint: https://twittercommunity.com/t/quote-tweets-api-can-use-exclude-parameter/171392 --- tweepy/asynchronous/client.py | 5 ++++- tweepy/client.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tweepy/asynchronous/client.py b/tweepy/asynchronous/client.py index 274f16d..27705a8 100644 --- a/tweepy/asynchronous/client.py +++ b/tweepy/asynchronous/client.py @@ -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 diff --git a/tweepy/client.py b/tweepy/client.py index 5f25c1a..aa3d34e 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -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 -- 2.25.1