From c49cbdfcbda48295591d731446cd03b2eb2332ae Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 7 Jan 2022 01:52:11 -0600 Subject: [PATCH] Add Client.get_me --- tweepy/client.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tweepy/client.py b/tweepy/client.py index 85a400a..56c8fef 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -1726,6 +1726,34 @@ class Client: ), data_type=User, user_auth=user_auth ) + def get_me(self, *, user_auth=False, **params): + """get_me(*, expansions, tweet_fields, user_fields) + + Returns information about an authorized user. + + Parameters + ---------- + expansions : Union[List[str], str] + :ref:`expansions_parameter` + tweet_fields : Union[List[str], str] + :ref:`tweet_fields_parameter` + user_fields : Union[List[str], str] + :ref:`user_fields_parameter` + + Returns + ------- + Union[dict, requests.Response, Response] + + References + ---------- + https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me + """ + return self._make_request( + "GET", f"/2/users/me", params=params, + endpoint_parameters=("expansions", "tweet.fields", "user.fields"), + data_type=User, user_auth=user_auth + ) + # Search Spaces def search_spaces(self, query, **params): -- 2.25.1