Stop allowing positional arguments for API.destroy_friendship
authorHarmon <Harmon758@gmail.com>
Fri, 12 Feb 2021 03:45:27 +0000 (21:45 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 12 Feb 2021 03:45:27 +0000 (21:45 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index a47f491e4098314add844ce9ac47080843f9efbd..97b3451b6c4d8b379a67ae071f8885ec9983822b 100644 (file)
@@ -564,12 +564,12 @@ class API:
         )
 
     @payload('user')
-    def destroy_friendship(self, *args, **kwargs):
+    def destroy_friendship(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy
         """
         return self.request(
-            'POST', 'friendships/destroy', *args, endpoint_parameters=(
-                'user_id', 'screen_name'
+            'POST', 'friendships/destroy', endpoint_parameters=(
+                'screen_name', 'user_id'
             ), **kwargs
         )