Davi
Davi

Reputation: 21

Tweepy: How do you check if a tweet is favorited?

I can check if a tweet is retweeted by me, but not if a tweet is favorited. Any solutions?

except tweet.id(retweeted):
        ignore
    except tweet.id(???)
        ignore

Upvotes: 2

Views: 518

Answers (1)

Jonathan Joshua
Jonathan Joshua

Reputation: 230

id = 1272479136133627905
  
# fetching the status 
status = api.get_status(id) 
  
# fetching the favorited attribute 
favorited = status.favorited  
  
if favorited == True: 
    print("The authenticated user has liked the tweet.") 
else: 
    print("The authenticated user has not liked the tweet.")```

Upvotes: 1

Related Questions