Add API.no_retweets_friendships
authorHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 18:10:05 +0000 (13:10 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 7 Apr 2021 18:10:05 +0000 (13:10 -0500)
docs/api.rst
tweepy/api.py

index eefd048eff7bbf7b2012c34a34325c85aa115338..32fbd33c536eda83047d1cfdb10ab8117fba4b5d 100644 (file)
@@ -123,6 +123,8 @@ Follow, search, and get users
 
 .. automethod:: API.lookup_friendships
 
+.. automethod:: API.no_retweets_friendships
+
 
 User methods
 ------------
index a991639a9299e5476f088e626e50ce2cfc5f56cb..ae3a76cc1262090d7d2cf187b8ab8eec92f348bb 100644 (file)
@@ -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