Update and improve documentation for API.mentions_timeline
authorHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 18:56:06 +0000 (13:56 -0500)
committerHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 18:56:06 +0000 (13:56 -0500)
Automatically use docstring for documentation
Improve method and documentation order
Add documentation for trim_user and include_entities parameters
Improve parameter order in documentation

docs/api.rst
tweepy/api.py

index 440648ee566745e45da6f62328255781789c96b5..00d7081e03c3a878ba00e897c09315dcab4dc826 100644 (file)
@@ -21,6 +21,8 @@ Timeline methods
 
 .. automethod:: API.home_timeline
 
+.. automethod:: API.mentions_timeline
+
 .. method:: API.statuses_lookup(id_, [include_entities], [trim_user], [map_], \
                                 [include_ext_alt_text], [include_card_uri])
 
@@ -72,16 +74,6 @@ Timeline methods
    :rtype: list of :class:`Status` objects
 
 
-.. method:: API.mentions_timeline([since_id], [max_id], [count])
-
-   Returns the 20 most recent mentions, including retweets.
-
-   :param since_id: |since_id|
-   :param max_id: |max_id|
-   :param count: |count|
-   :rtype: list of :class:`Status` objects
-
-
 Status methods
 --------------
 
index f0652765054228dd5c11074c2a3aad1dc8bb958c..012bc1c9b201741b64947d2786c95c20589e7f3c 100644 (file)
@@ -279,6 +279,30 @@ class API:
             ), **kwargs
         )
 
+    @pagination(mode='id')
+    @payload('status', list=True)
+    def mentions_timeline(self, **kwargs):
+        """mentions_timeline(*, count, since_id, max_id, trim_user, \
+                             include_entities)
+
+        Returns the 20 most recent mentions, including retweets.
+
+        :param count: |count|
+        :param since_id: |since_id|
+        :param max_id: |max_id|
+        :param trim_user: |trim_user|
+        :param include_entities: |include_entities|
+
+        :rtype: list of :class:`Status` objects
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline
+        """
+        return self.request(
+            'GET', 'statuses/mentions_timeline', endpoint_parameters=(
+                'count', 'since_id', 'max_id', 'trim_user', 'include_entities'
+            ), **kwargs
+        )
+
     @payload('status', list=True)
     def statuses_lookup(self, id, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup
@@ -302,17 +326,6 @@ class API:
             ), **kwargs
         )
 
-    @pagination(mode='id')
-    @payload('status', list=True)
-    def mentions_timeline(self, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline
-        """
-        return self.request(
-            'GET', 'statuses/mentions_timeline', endpoint_parameters=(
-                'count', 'since_id', 'max_id', 'trim_user', 'include_entities'
-            ), **kwargs
-        )
-
     @pagination(mode='id')
     @payload('status', list=True)
     def retweets_of_me(self, **kwargs):