.. 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], \
), **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
), 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,