Update and improve documentation for API.mutes
authorHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 14:49:53 +0000 (09:49 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 14:49:53 +0000 (09:49 -0500)
Automatically use docstring for documentation
Improve method and documentation order

docs/api.rst
tweepy/api.py

index 11ee3892edb7720322347547b0c09567f09e1910..7c76c679ed93c50dfbc11215ca9c778383a05c08 100644 (file)
@@ -177,6 +177,8 @@ Mute, block, and report users
 
 .. automethod:: API.mutes_ids
 
+.. automethod:: API.mutes
+
 
 Direct Message Methods
 ----------------------
@@ -296,16 +298,6 @@ Mute Methods
    :rtype: :class:`User` object
 
 
-.. method:: API.mutes([cursor], [include_entities], [skip_status])
-
-   Returns an array of user objects the authenticating user has muted.
-
-   :param cursor: |cursor|
-   :param include_entities: |include_entities|
-   :param skip_status: |skip_status|
-   :rtype: list of :class:`User` objects
-
-
 Spam Reporting Methods
 ----------------------
 
index 385cfbaa49e1e826523848d2ec94517577a7532b..380923d40890f7648432395e3fbd01c3c512e466 100644 (file)
@@ -2070,6 +2070,27 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='cursor')
+    @payload('user', list=True)
+    def mutes(self, **kwargs):
+        """mutes(*, cursor, include_entities, skip_status)
+
+        Returns an array of user objects the authenticating user has muted.
+
+        :param cursor: |cursor|
+        :param include_entities: |include_entities|
+        :param skip_status: |skip_status|
+
+        :rtype: list of :class:`User` objects
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list
+        """
+        return self.request(
+            'GET', 'mutes/users/list', endpoint_parameters=(
+                'cursor', 'include_entities', 'skip_status'
+            ), **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
@@ -2329,17 +2350,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='cursor')
-    @payload('user', list=True)
-    def mutes(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list
-        """
-        return self.request(
-            'GET', 'mutes/users/list', endpoint_parameters=(
-                'cursor', 'include_entities', 'skip_status'
-            ), **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