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

tweepy/api.py

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