From: Harmon Date: Fri, 28 May 2021 13:01:11 +0000 (-0500) Subject: Rename API.list_direct_messages to API.get_direct_messages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ff1186f80b2dbb7f5e4ed3669d90db300e8de36d;p=tweepy.git Rename API.list_direct_messages to API.get_direct_messages --- diff --git a/cassettes/testlistdirectmessages.json b/cassettes/testgetdirectmessages.json similarity index 100% rename from cassettes/testlistdirectmessages.json rename to cassettes/testgetdirectmessages.json diff --git a/docs/api.rst b/docs/api.rst index 50502ca..ec02bb1 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -192,7 +192,7 @@ +------------------------------------------+-------------------------------------+ | `DELETE direct_messages/events/destroy`_ | :meth:`API.destroy_direct_message` | +------------------------------------------+-------------------------------------+ - | `GET direct_messages/events/list`_ | :meth:`API.list_direct_messages` | + | `GET direct_messages/events/list`_ | :meth:`API.get_direct_messages` | +------------------------------------------+-------------------------------------+ | `GET direct_messages/events/show`_ | :meth:`API.get_direct_message` | +------------------------------------------+-------------------------------------+ @@ -556,7 +556,7 @@ Sending and receiving events .. automethod:: API.destroy_direct_message -.. automethod:: API.list_direct_messages +.. automethod:: API.get_direct_messages .. automethod:: API.get_direct_message diff --git a/tests/test_api.py b/tests/test_api.py index 84671de..76c5faf 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -131,9 +131,9 @@ class TweepyAPITests(TweepyTestCase): def testsearchusers(self): self.api.search_users('twitter') - @tape.use_cassette('testlistdirectmessages.json') - def testlistdirectmessages(self): - self.api.list_direct_messages() + @tape.use_cassette('testgetdirectmessages.json') + def testgetdirectmessages(self): + self.api.get_direct_messages() @tape.use_cassette('testsendanddestroydirectmessage.json') def testsendanddestroydirectmessage(self): diff --git a/tweepy/api.py b/tweepy/api.py index 628237f..377688e 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -3179,8 +3179,8 @@ class API: @pagination(mode='dm_cursor') @payload('direct_message', list=True) - def list_direct_messages(self, **kwargs): - """list_direct_messages(*, count, cursor) + def get_direct_messages(self, **kwargs): + """get_direct_messages(*, count, cursor) Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.