Update and improve documentation for API.get_direct_message
authorHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 21:53:04 +0000 (16:53 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 10 Apr 2021 21:53:04 +0000 (16:53 -0500)
Automatically use docstring for documentation
Improve method order
Remove full_text parameter from documentation
Improve capitalization

docs/api.rst
tweepy/api.py

index 20d2295de1b49adaf607e641ecf1b45f7a51ad2e..f8975bf3f9dc458463262c78967f1b401107b9fe 100644 (file)
@@ -199,14 +199,7 @@ Sending and receiving events
 
 .. automethod:: API.list_direct_messages
 
-
-.. method:: API.get_direct_message([id], [full_text])
-
-   Returns a specific direct message.
-
-   :param id: The id of the Direct Message event that should be returned.
-   :param full_text: |full_text|
-   :rtype: :class:`DirectMessage` object
+.. automethod:: API.get_direct_message
 
 
 .. method:: API.send_direct_message(recipient_id, text, [quick_reply_type], \
index b7d187fab680eb03e77e7a2d6aaac8e8f902be0d..6eafa25d919d1eb75dda639f51cefbdb397b457b 100644 (file)
@@ -2233,6 +2233,24 @@ class API:
             ), **kwargs
         )
 
+    @payload('direct_message')
+    def get_direct_message(self, id, **kwargs):
+        """get_direct_message(id)
+
+        Returns a specific direct message.
+
+        :param id: The ID of the Direct Message event that should be returned.
+
+        :rtype: :class:`DirectMessage` object
+
+        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event
+        """
+        return self.request(
+            'GET', 'direct_messages/events/show', endpoint_parameters=(
+                'id',
+            ), id=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
@@ -2400,16 +2418,6 @@ class API:
             ), command='STATUS', media_id=media_id, upload_api=True, **kwargs
         )
 
-    @payload('direct_message')
-    def get_direct_message(self, id, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event
-        """
-        return self.request(
-            'GET', 'direct_messages/events/show', endpoint_parameters=(
-                'id',
-            ), id=id, **kwargs
-        )
-
     @payload('direct_message')
     def send_direct_message(self, recipient_id, text, *, quick_reply_options=None,
                             attachment_type=None, attachment_media_id=None,