Get latest direct message + sender id based on user - Tweepy

193 views Asked by At

I was wondering how I could get the latest message in a DM using Tweepy as well as the ID of the sender. I would retrieve this conversation using the ID of the person I am DM'ing For example:

If user 1 has an ID of 1188288042026635265 and user 2 has an ID of 1317999444177129476 and the conversation looked something like this:

user 1: Hello
user 2: Hello how are you?
user 1: I am good
user 2: that is good to hear

For the sake of this example, let's say user 1 is the user I am using Tweepy from. I would retrieve this conversation using 1317999444177129476 Then the method would return that is good to hear and 1317999444177129476.I appreciate the help in advance, thank you!

0

There are 0 answers