From: Harmon Date: Mon, 11 Jan 2021 16:58:53 +0000 (-0600) Subject: Allow sending Call-To-Action buttons with Direct Messages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=97758002a9fd79b50f3834a5487237f392d52a48;p=tweepy.git Allow sending Call-To-Action buttons with Direct Messages In API.send_direct_message Resolves #1311 --- diff --git a/tweepy/api.py b/tweepy/api.py index 1f5984b..ef87b36 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -441,7 +441,8 @@ class API: ) def send_direct_message(self, recipient_id, text, quick_reply_options=None, - attachment_type=None, attachment_media_id=None): + attachment_type=None, attachment_media_id=None, + ctas=None): """ :reference: https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event :allowed_param: 'recipient_id', 'text', 'quick_reply_type', 'attachment_type', attachment_media_id' @@ -465,6 +466,8 @@ class API: 'type': attachment_type, 'media': {'id': attachment_media_id} } + if ctas is not None: + message_data['ctas'] = ctas return bind_api( api=self, path='/direct_messages/events/new.json',