Skip to content

Add a throttle to handle rate-limiting automatically

Compare
Choose a tag to compare
@breqdev breqdev released this 14 Apr 20:48
· 426 commits to main since this release

Add a throttle to handle Discord rate-limiting automatically.

Discord lowered the rate-limit for slash command registration. Previously, this library did not respect the rate limit, and it would crash if it received a 429 Too Many Requests from Discord. This update uses the X-RateLimit headers, as per the Discord docs, to add a time delay between requests if necessary to avoid this issue.

Thank you to @bradday4 for submitting this PR (#7)!