twilight
twilight copied to clipboard
Support `X-Ratelimit-Scope`
Parse X-Ratelimit-Scope
in response headers and deal with it accordingly. For now I suggest we simply ignore shared ratelimits, because we can't know whether our timer is still accurate.
- [x] support parsing header (#1351)
- [ ] use retry-after on shared ratelimits
Docs: https://github.com/discord/discord-api-docs/commit/60a0e3d99d014fa9036a1d30b0d2ac8ec7bfb987
i don't see how ignoring them makes any sense? we only get the header if we got rate limited, and thus it will give us the correct time to wait then. the rest of the headers still returns the regular rate limit
You're right, we should still respect it.
According to devsnek this header can just be ignored: https://github.com/discord/discord-api-docs/pull/4013#issuecomment-954341664
it can be ignored but exposing it can still be useful to downstream consumers and especially debugging http proxy rate limit issues to know if the limit we hit could/should have been avoided or not