Update and improve documentation for API.create_mute
authorHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 15:18:20 +0000 (10:18 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 15:20:39 +0000 (10:20 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Remove id parameter from documentation

docs/api.rst
tweepy/api.py

index 0033461924a6586a34e6bfd40f84ecd51bd4d499..e2e502483b17ac3c83ed2b65122107d107bbbe5a 100644 (file)
@@ -183,6 +183,8 @@ Mute, block, and report users
 
 .. automethod:: API.destroy_block
 
+.. automethod:: API.create_mute
+
 
 Direct Message Methods
 ----------------------
@@ -257,16 +259,6 @@ Account Methods
 Mute Methods
 ------------
 
-.. method:: API.create_mute(id/screen_name/user_id)
-
-   Mutes the user specified in the ID parameter for the authenticating user.
-
-   :param id: |uid|
-   :param screen_name: |screen_name|
-   :param user_id: |user_id|
-   :rtype: :class:`User` object
-
-
 .. method:: API.destroy_mute(id/screen_name/user_id)
 
    Un-mutes the user specified in the ID parameter for the authenticating user.
index 8065067552a027af21db7bf7c0e7c89f8a61a49f..28705dae5c4ce969ef50ef9d1d8163bca09b7785 100644 (file)
@@ -2138,6 +2138,26 @@ class API:
             ), **kwargs
         )
 
+    @payload('user')
+    def create_mute(self, **kwargs):
+        """create_mute(*, screen_name, user_id)
+
+        Mutes the user specified in the ID parameter for the authenticating
+        user.
+
+        :param screen_name: |screen_name|
+        :param user_id: |user_id|
+
+        :rtype: :class:`User` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-create
+        """
+        return self.request(
+            'POST', 'mutes/users/create', endpoint_parameters=(
+                'screen_name', 'user_id'
+            ), **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
@@ -2377,16 +2397,6 @@ class API:
             ), use_cache=False, **kwargs
         )
 
-    @payload('user')
-    def create_mute(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-create
-        """
-        return self.request(
-            'POST', 'mutes/users/create', endpoint_parameters=(
-                'screen_name', 'user_id'
-            ), **kwargs
-        )
-
     @payload('user')
     def destroy_mute(self, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-destroy