From: Harmon Date: Wed, 7 Apr 2021 18:10:05 +0000 (-0500) Subject: Add API.no_retweets_friendships X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=496a3993ae6f6048059c3e9ee2a6f08a27f654b9;p=tweepy.git Add API.no_retweets_friendships --- diff --git a/docs/api.rst b/docs/api.rst index eefd048..32fbd33 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -123,6 +123,8 @@ Follow, search, and get users .. automethod:: API.lookup_friendships +.. automethod:: API.no_retweets_friendships + User methods ------------ diff --git a/tweepy/api.py b/tweepy/api.py index a991639..ae3a76c 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1529,6 +1529,25 @@ class API: user_id=list_to_csv(user_id), **kwargs ) + @payload('json') + def no_retweets_friendships(self, **kwargs): + """no_retweets_friendships(*, stringify_ids) + + Returns a collection of user_ids that the currently authenticated user + does not want to receive retweets from. + + :param stringify_ids: |stringify_ids| + + :rtype: list of :class:`int` + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids + """ + return self.request( + 'GET', 'friendships/no_retweets/ids', endpoint_parameters=( + 'stringify_ids', + ), **kwargs + ) + def media_upload(self, filename, *, file=None, chunked=False, media_category=None, additional_owners=None, **kwargs): """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview