From: Harmon Date: Thu, 27 May 2021 11:59:54 +0000 (-0500) Subject: Update and improve documentation for API.send_direct_message X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=80886f9c8239cfb410e3a8fd07f706b4faab9052;p=tweepy.git Update and improve documentation for API.send_direct_message --- diff --git a/tweepy/api.py b/tweepy/api.py index 8f4993d..0c3cb95 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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',