I am able to get everything on the timeline, but can't seem to return direct messages. I have been searching the API documentation, but there doesn't appear to be any function or method that is obvious to me. Any assistance would be appreciated. My function currently looks like this:
def get_direct_messages(mastodon):
# Get all status messages from the user's timeline
statuses = mastodon.timeline()
print(statuses)
# Filter the status messages to only include direct messages
direct_messages = [status for status in statuses if status["visibility"] == "direct"]
print (direct_messages)
return direct_messages
This will print out all the messages on the timeline, so I know the connection and everything is valid, but I'm just not doing something right. print(statuses) shows timeline messages only, so I am sure this isn't the right way to access direct messages.
I am able to get everything on the timeline, but can't seem to return direct messages. I have been searching the API documentation, but there doesn't appear to be any function or method that is obvious to me. Any assistance would be appreciated. My function currently looks like this:
This will print out all the messages on the timeline, so I know the connection and everything is valid, but I'm just not doing something right. print(statuses) shows timeline messages only, so I am sure this isn't the right way to access direct messages.