Update and improve documentation for API.send_direct_message
authorHarmon <Harmon758@gmail.com>
Thu, 27 May 2021 11:59:54 +0000 (06:59 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 27 May 2021 11:59:54 +0000 (06:59 -0500)
tweepy/api.py

index 8f4993d6a9e457bbdfed24357b76c0dfb63d827b..0c3cb9583df7580cb5897f06dbbaf87c6f76b22a 100644 (file)
@@ -3239,20 +3239,29 @@ class API:
         Sends a new direct message to the specified user from the
         authenticating user.
 
-        :param recipient_id: The ID of the user who should receive the direct
-                             message.
-        :param text: The text of your Direct Message. Max length of 10,000
-                     characters.
-        :param quick_reply_options: Array of Options objects (20 max).
-        :param attachment_type: The attachment type. Can be media or location.
-        :param attachment_media_id: A media id to associate with the message.
-                                    A Direct Message may only reference a
-                                    single media_id.
-        :param ctas: Array of 1-3 call-to-action (CTA) button objects
-
-        :rtype: :class:`DirectMessage` object
-
-        :reference: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event
+        Parameters
+        ----------
+        recipient_id
+            The ID of the user who should receive the direct message.
+        text
+            The text of your Direct Message. Max length of 10,000 characters.
+        quick_reply_options
+            Array of Options objects (20 max).
+        attachment_type
+            The attachment type. Can be media or location.
+        attachment_media_id
+            A media id to associate with the message. A Direct Message may only
+            reference a single media_id.
+        ctas
+            Array of 1-3 call-to-action (CTA) button objects
+
+        Returns
+        -------
+        :class:`~tweepy.models.DirectMessage`
+
+        References
+        ----------
+        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event
         """
         json_payload = {
             'event': {'type': 'message_create',