Commit cda2a312 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #664 from tjphopkins/full_text

Allow 'full_text' param when getting direct messages
parents 954b2f48 2e2657dd
...@@ -216,7 +216,7 @@ User methods ...@@ -216,7 +216,7 @@ User methods
Direct Message Methods Direct Message Methods
---------------------- ----------------------
.. method:: API.direct_messages([since_id], [max_id], [count], [page]) .. method:: API.direct_messages([since_id], [max_id], [count], [page], [full_text])
Returns direct messages sent to the authenticating user. Returns direct messages sent to the authenticating user.
...@@ -224,10 +224,20 @@ Direct Message Methods ...@@ -224,10 +224,20 @@ Direct Message Methods
:param max_id: |max_id| :param max_id: |max_id|
:param count: |count| :param count: |count|
:param page: |page| :param page: |page|
:param full_text: |full_text|
:rtype: list of :class:`DirectMessage` objects :rtype: list of :class:`DirectMessage` objects
.. method:: API.sent_direct_messages([since_id], [max_id], [count], [page]) .. method:: API.get_direct_message([id], [full_text])
Returns a specific direct message.
:param id: |id|
:param full_text: |full_text|
:rtype: :class:`DirectMessage` object
.. method:: API.sent_direct_messages([since_id], [max_id], [count], [page], [full_text])
Returns direct messages sent by the authenticating user. Returns direct messages sent by the authenticating user.
...@@ -235,6 +245,7 @@ Direct Message Methods ...@@ -235,6 +245,7 @@ Direct Message Methods
:param max_id: |max_id| :param max_id: |max_id|
:param count: |count| :param count: |count|
:param page: |page| :param page: |page|
:param full_text: |full_text|
:rtype: list of :class:`DirectMessage` objects :rtype: list of :class:`DirectMessage` objects
......
...@@ -14,4 +14,5 @@ ...@@ -14,4 +14,5 @@
.. |slug| replace:: the slug name or numerical ID of the list .. |slug| replace:: the slug name or numerical ID of the list
.. |list_mode| replace:: Whether your list is public or private. Values can be public or private. Lists are public by default if no mode is specified. .. |list_mode| replace:: Whether your list is public or private. Values can be public or private. Lists are public by default if no mode is specified.
.. |list_owner| replace:: the screen name of the owner of the list .. |list_owner| replace:: the screen name of the owner of the list
.. |full_text| replace:: A boolean indicating whether or not the full text of a message should be returned. If False the message text returned will be truncated to 140 chars. Defaults to False.
...@@ -392,39 +392,39 @@ class API(object): ...@@ -392,39 +392,39 @@ class API(object):
@property @property
def direct_messages(self): def direct_messages(self):
""" :reference: https://dev.twitter.com/rest/reference/get/direct_messages """ :reference: https://dev.twitter.com/rest/reference/get/direct_messages
:allowed_param:'since_id', 'max_id', 'count' :allowed_param:'since_id', 'max_id', 'count', 'full_text'
""" """
return bind_api( return bind_api(
api=self, api=self,
path='/direct_messages.json', path='/direct_messages.json',
payload_type='direct_message', payload_list=True, payload_type='direct_message', payload_list=True,
allowed_param=['since_id', 'max_id', 'count'], allowed_param=['since_id', 'max_id', 'count', 'full_text'],
require_auth=True require_auth=True
) )
@property @property
def get_direct_message(self): def get_direct_message(self):
""" :reference: https://dev.twitter.com/rest/reference/get/direct_messages/show """ :reference: https://dev.twitter.com/rest/reference/get/direct_messages/show
:allowed_param:'id' :allowed_param:'id', 'full_text'
""" """
return bind_api( return bind_api(
api=self, api=self,
path='/direct_messages/show/{id}.json', path='/direct_messages/show/{id}.json',
payload_type='direct_message', payload_type='direct_message',
allowed_param=['id'], allowed_param=['id', 'full_text'],
require_auth=True require_auth=True
) )
@property @property
def sent_direct_messages(self): def sent_direct_messages(self):
""" :reference: https://dev.twitter.com/rest/reference/get/direct_messages/sent """ :reference: https://dev.twitter.com/rest/reference/get/direct_messages/sent
:allowed_param:'since_id', 'max_id', 'count', 'page' :allowed_param:'since_id', 'max_id', 'count', 'page', 'full_text'
""" """
return bind_api( return bind_api(
api=self, api=self,
path='/direct_messages/sent.json', path='/direct_messages/sent.json',
payload_type='direct_message', payload_list=True, payload_type='direct_message', payload_list=True,
allowed_param=['since_id', 'max_id', 'count', 'page'], allowed_param=['since_id', 'max_id', 'count', 'page', 'full_text'],
require_auth=True require_auth=True
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment