Stop allowing positional arguments for API.create_block
authorHarmon <Harmon758@gmail.com>
Sat, 13 Feb 2021 22:08:35 +0000 (16:08 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 13 Feb 2021 22:08:35 +0000 (16:08 -0600)
Also improve endpoint parameters order to match Twitter API documentation

tweepy/api.py

index c157f88b6a6a076bcc314ae1d5347d89c88f4199..8e32ec492d21032761495e8b0b6c63e1bca1f8f7 100644 (file)
@@ -771,12 +771,12 @@ class API:
         )
 
     @payload('user')
-    def create_block(self, *args, **kwargs):
+    def create_block(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/mute-block-report-users/api-reference/post-blocks-create
         """
         return self.request(
-            'POST', 'blocks/create', *args, endpoint_parameters=(
-                'user_id', 'screen_name', 'include_entities', 'skip_status'
+            'POST', 'blocks/create', endpoint_parameters=(
+                'screen_name', 'user_id', 'include_entities', 'skip_status'
             ), **kwargs
         )