diff options
Diffstat (limited to 'build/hypixelApi.js')
-rw-r--r-- | build/hypixelApi.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/build/hypixelApi.js b/build/hypixelApi.js index 59a798c..7c1176e 100644 --- a/build/hypixelApi.js +++ b/build/hypixelApi.js @@ -81,12 +81,12 @@ async function sendApiRequest({ path, key, args }) { await new Promise((resolve) => setTimeout(resolve, 30000)); 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) { if (apiKeyUsage[key]) |