From d2cb96ac8619d53a4fbdba1dae5fd43ad8ec53ad Mon Sep 17 00:00:00 2001 From: ayntee Date: Sat, 27 Mar 2021 16:59:19 +0400 Subject: [PATCH] types: add RateLimitData interface --- src/bot.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/bot.ts b/src/bot.ts index c5f10703a..832a1d748 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -292,6 +292,21 @@ export interface EventHandlers { inviteDelete?: (data: CamelCaseProps) => unknown; } +export interface RateLimitData { + /** The number of remaining requests that can be made */ + remaining: string | null; + /** Epoch time (seconds since 00:00:00 UTC on January 1, 1970) at which the rate limit resets */ + resetTimestamp: string | null; + /** Total time (in seconds) of when the current rate limit bucket will reset. Can have decimals to match previous millisecond ratelimit precision */ + retryAfter: string | null; + /** Returned only on a HTTP 429 response if the rate limit headers returned are of the global rate limit (not per-route) */ + global: string | null; + /** A unique string denoting the rate limit being encountered (non-inclusive of major parameters in the route path) */ + bucketID: string | null; + /** The URL the HTTP request is made to */ + url: string; +} + export interface BotConfig { token: string; compress?: boolean;