From: Harmon Date: Tue, 27 Apr 2021 14:50:20 +0000 (-0500) Subject: Improve clarity of Client.like X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=085d5860e897230fb7ba3b1847e43e576c74a792;p=tweepy.git Improve clarity of Client.like --- diff --git a/tweepy/client.py b/tweepy/client.py index e8f2456..6c338f2 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -264,9 +264,10 @@ class Client: https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-user_id-likes """ id = self.access_token.partition('-')[0] + route = f"/2/users/{id}/likes" + return self._make_request( - "POST", f"/2/users/{id}/likes", json={"tweet_id": str(tweet_id)}, - user_auth=True + "POST", route, json={"tweet_id": str(tweet_id)}, user_auth=True )[0]["liked"] # Search Tweets