diff options
Diffstat (limited to 'src/hypixelApi.ts')
-rw-r--r-- | src/hypixelApi.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts index a212f34..886b261 100644 --- a/src/hypixelApi.ts +++ b/src/hypixelApi.ts @@ -170,12 +170,12 @@ export async function sendApiRequest({ path, key, args }): Promise<HypixelRespon return await sendApiRequest({ path, key, args }) } - if (fetchResponse.headers['ratelimit-limit']) + if (fetchResponse.headers.get('ratelimit-limit')) // remember how many uses it has apiKeyUsage[key] = { - remaining: fetchResponse.headers['ratelimit-remaining'], - limit: fetchResponse.headers['ratelimit-limit'], - reset: Date.now() + parseInt(fetchResponse.headers['ratelimit-reset']) * 1000 + remaining: parseInt(fetchResponse.headers.get('ratelimit-remaining')), + limit: parseInt(fetchResponse.headers.get('ratelimit-limit')), + reset: Date.now() + parseInt(fetchResponse.headers.get('ratelimit-reset')) * 1000 } if (fetchJsonParsed.throttle) { |