Query string overhaul, add wait=true for webhooks
Created by: uwx
Summary
This supercedes #440.
Details
I modified Allan's PR and introduced QueryUriBuilder class instead of the dictionary mess. In addition, that dictionary mess was incredibly inconsistent - there were loads of places in the lib where query strings were hardwired. I replaced all these with QueryUriBuilder usages, which for the most part just makes them more readable. It also saves quite a few Dictionary allocations for the webhook endpoints.
The only places where hardcoded query strings still remain are when the library simply returns a link, say, to an image. For instance:
I left these as-is since there are so many of them and they seem to be very purposefully hardcoded. If you want these to use the query URI builder, let me know.
Additionally, I fixed a bug in GetCurrentUserGuildsAsync
where the rest ratelimit bucket was dependant on the query parameters. I don't know if the original behavior was intentional, please let me know if so.
I want to hear your opinions, so I'm leaving this PR as a draft for now.
Changes proposed
- Create QueryUriBuilder
- Patch up hardcoded query URIs into the nicer, cleaner builder format
- Make the parameters of
GetCurrentUserGuildsAsync
not part of the ratelimit bucket
Notes
Credits to @Kiritsu for doing the hard part.