feature: support X-RateLimit-Reset-After (#1372)

* feature: support X-RateLimit-Reset-After

Users may now optionally disable using the system clock to calculate
the ratelimit duration. This may be overrided globally, via
DiscordConfig, or per RequestOptions.

This change has been built and tested via the integrated test suite,
but has not been tested in the real world. Please verify this does not
break any of the edge-case ratelimits.

* patch: wire new config properties to ApiClient

* patch: update Reset-After parsing precision

This patch applies the changes made to parsing precision in 606dac3.
This commit is contained in:
Christopher F
2019-09-21 09:24:37 -04:00
committed by GitHub
parent 68eb71c175
commit 7b9029dd91
8 changed files with 55 additions and 5 deletions

View File

@@ -81,7 +81,8 @@ namespace Discord.WebSocket
: base(config, client) => BaseConfig = config;
private static DiscordSocketApiClient CreateApiClient(DiscordSocketConfig config)
=> new DiscordSocketApiClient(config.RestClientProvider, config.WebSocketProvider, DiscordRestConfig.UserAgent,
rateLimitPrecision: config.RateLimitPrecision);
rateLimitPrecision: config.RateLimitPrecision,
useSystemClock: config.UseSystemClock);
/// <summary>
/// Gets a Discord application information for the logged-in user.