Closed DieserMerlin closed 5 years ago
Architectual approach: It makes fully sense to seperate requests that need an user onto an own class. This can for example be seen here when requesting data about the specific user itself:
UserDTO user = TwitchAPI.helix().users().withAuth(personalCtx).getCurrentUser();
By specifiying withAuth, we insert the personal context which includes the access token that we want to provide.
List<UserDTO> = TwitchAPI.helix().users().getUsers(null, {"larcce"});
Now we need to insert an options object, I would do it like this:
List<UserDTO> = TwitchAPI.helix().users().getUsers(null, {"larcce"}, new TwitchRequestOptions().withAuth(personalContext));
We can also extend the options object later on. This will be useful when it comes to rate limiting.
Decrease rate limiting problems by providing a bearer token for every request (as seen in https://dev.twitch.tv/docs/api/guide/#rate-limits)