Twitch-Python icon indicating copy to clipboard operation
Twitch-Python copied to clipboard

Get user who owns bearer token with Helix API

Open alexf91 opened this issue 6 years ago • 1 comments

The Twitch API returns the user who owns the bearer token when no arguments are provided to https://api.twitch.tv/helix/users.

If neither a user ID nor a login name is specified, the user is looked up by Bearer token. https://dev.twitch.tv/docs/api/reference/#get-users

This is currently not possible, because of this check: https://github.com/PetterKraabol/Twitch-Python/blob/104c0bc0c8dbb3a1292a45a4d0838cc8222aba82/twitch/helix/resources/users.py#L44

To keep the API consistent, this behavior should probably only be added for Helix.user() and not to Helix.users(). This way there is no confusion when an empty user list is requested. Otherwise, an empty user list could return a non-empty result.

I have implemented it here, but it seems a bit hacky: https://github.com/PetterKraabol/Twitch-Python/compare/master...alexf91:current_user

alexf91 avatar Aug 29 '19 12:08 alexf91

Seems no progress here..

lebedynskyi avatar Aug 08 '22 10:08 lebedynskyi