Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 2674a54

Browse files
committed
Merge pull request #266 from mistersalmon/master
Add full_text and page options in GetDirectMessages function
2 parents af03c22 + e589979 commit 2674a54

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

twitter/api.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,9 @@ def GetDirectMessages(self,
19481948
max_id=None,
19491949
count=None,
19501950
include_entities=True,
1951-
skip_status=False):
1951+
skip_status=False,
1952+
full_text=False,
1953+
page=None):
19521954
"""Returns a list of the direct messages sent to the authenticating user.
19531955
19541956
The twitter.Api instance must be authenticated.
@@ -1974,6 +1976,14 @@ def GetDirectMessages(self,
19741976
skip_status:
19751977
When set to True statuses will not be included in the returned user
19761978
objects. [Optional]
1979+
full_text:
1980+
When set to True full message will be included in the returned message
1981+
object if message length is bigger than 140 characters. [Optional]
1982+
page:
1983+
If you want more than 200 messages, you can use this and get 20 messages
1984+
each time. You must recall it and increment the page value until it
1985+
return nothing. You can't use count option with it. First value is 1 and
1986+
not 0.
19771987
19781988
Returns:
19791989
A sequence of twitter.DirectMessage instances
@@ -1996,6 +2006,10 @@ def GetDirectMessages(self,
19962006
parameters['include_entities'] = 'false'
19972007
if skip_status:
19982008
parameters['skip_status'] = 1
2009+
if full_text:
2010+
parameters['full_text'] = 'true'
2011+
if page:
2012+
parameters['page'] = page
19992013

20002014
json_data = self._RequestUrl(url, 'GET', data=parameters)
20012015
data = self._ParseAndCheckTwitter(json_data.content)

0 commit comments

Comments
 (0)