You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RequestHandler was built to built to handle memory storage of the token without having to pass it through the method arguments each time, and as a way to only provide what was needed to the action flow itself.
Despite that, it has no idea what ratelimit headers mean - nor how to handle them.
4 requests are made to Discord, all on a different API route.
GET /users/@me - Checking that the token works, and getting the ID of the authenticated user for later
GET /guilds/{guildID} - Checking that the guild exists and that the authenticated user is a member (also uses role data for permission and hierarchy checks)
GET /guilds/{guildID}/members/{userID} - We know that the user exists, but we didn't have their ID before starting so that's used here.
PATCH /guilds/{guildID}/roles/{roleID} - The final request to update the role with its new color and name.
While the request to fetch the data for the randomly chosen colour is outside the scope of this issue, it would be worth considering if it should reside in the request handler as it's own method (and also allowing for the payload to be trimmed only to what is needed).
The text was updated successfully, but these errors were encountered:
RequestHandler
was built to built to handle memory storage of the token without having to pass it through the method arguments each time, and as a way to only provide what was needed to the action flow itself.Despite that, it has no idea what ratelimit headers mean - nor how to handle them.
4 requests are made to Discord, all on a different API route.
GET /users/@me
- Checking that the token works, and getting the ID of the authenticated user for laterGET /guilds/{guildID}
- Checking that the guild exists and that the authenticated user is a member (also uses role data for permission and hierarchy checks)GET /guilds/{guildID}/members/{userID}
- We know that the user exists, but we didn't have their ID before starting so that's used here.PATCH /guilds/{guildID}/roles/{roleID}
- The final request to update the role with its new color and name.While the request to fetch the data for the randomly chosen colour is outside the scope of this issue, it would be worth considering if it should reside in the request handler as it's own method (and also allowing for the payload to be trimmed only to what is needed).
The text was updated successfully, but these errors were encountered: