Stop allowing positional arguments for API.add_list_member
authorHarmon <Harmon758@gmail.com>
Sun, 14 Feb 2021 06:55:21 +0000 (00:55 -0600)
committerHarmon <Harmon758@gmail.com>
Sun, 14 Feb 2021 06:55:21 +0000 (00:55 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index 72505e18e1e0b175b9f32b3d743710bb103136ec..b8566444235dfa8132c636334ab56a474d5a16dc 100644 (file)
@@ -990,13 +990,13 @@ class API:
         )
 
     @payload('list')
-    def add_list_member(self, *args, **kwargs):
+    def add_list_member(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create
         """
         return self.request(
-            'POST', 'lists/members/create', *args, endpoint_parameters=(
-                'screen_name', 'user_id', 'owner_screen_name', 'owner_id',
-                'slug', 'list_id'
+            'POST', 'lists/members/create', endpoint_parameters=(
+                'list_id', 'slug', 'user_id', 'screen_name',
+                'owner_screen_name', 'owner_id'
             ), **kwargs
         )