aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package-lock.json14
-rw-r--r--package.json2
-rw-r--r--src/hypixelApi.ts8
3 files changed, 12 insertions, 12 deletions
diff --git a/package-lock.json b/package-lock.json
index 0b41db7..ce5fa4f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,7 +18,7 @@
"prismarine-nbt": "github:PrismarineJS/prismarine-nbt",
"prom-client": "^14.0.1",
"queue-promise": "^2.2.1",
- "typed-hypixel-api": "^0.5.1",
+ "typed-hypixel-api": "^0.6.0",
"uuid": "^8.3.2"
},
"devDependencies": {
@@ -2734,9 +2734,9 @@
}
},
"node_modules/typed-hypixel-api": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/typed-hypixel-api/-/typed-hypixel-api-0.5.1.tgz",
- "integrity": "sha512-VuQ/QyrCz8irmJbkydAvc89zwNf7Xc269GQgjwkN86j/Q9luhnUwk0Q2d6qVgwfNaFibYwmX8NbYCLj+mOk5uA==",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/typed-hypixel-api/-/typed-hypixel-api-0.6.0.tgz",
+ "integrity": "sha512-wvv23ZfWTbGx4n+aM6QakDaqjFiLOz2Bdk1NtlIqDPW6uL5PnpcXUFnwBD81++wcXxmskxMjnUlX+rzD6tbRSg==",
"dependencies": {
"typescript": "^4.6.3",
"undici": "^4.16.0"
@@ -5070,9 +5070,9 @@
}
},
"typed-hypixel-api": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/typed-hypixel-api/-/typed-hypixel-api-0.5.1.tgz",
- "integrity": "sha512-VuQ/QyrCz8irmJbkydAvc89zwNf7Xc269GQgjwkN86j/Q9luhnUwk0Q2d6qVgwfNaFibYwmX8NbYCLj+mOk5uA==",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/typed-hypixel-api/-/typed-hypixel-api-0.6.0.tgz",
+ "integrity": "sha512-wvv23ZfWTbGx4n+aM6QakDaqjFiLOz2Bdk1NtlIqDPW6uL5PnpcXUFnwBD81++wcXxmskxMjnUlX+rzD6tbRSg==",
"requires": {
"typescript": "^4.6.3",
"undici": "^4.16.0"
diff --git a/package.json b/package.json
index 7f8d58e..26129ea 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,7 @@
"prismarine-nbt": "github:PrismarineJS/prismarine-nbt",
"prom-client": "^14.0.1",
"queue-promise": "^2.2.1",
- "typed-hypixel-api": "^0.5.1",
+ "typed-hypixel-api": "^0.6.0",
"uuid": "^8.3.2"
},
"devDependencies": {
diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts
index 5f2bfb1..42d4f74 100644
--- a/src/hypixelApi.ts
+++ b/src/hypixelApi.ts
@@ -131,12 +131,12 @@ export let sendApiRequest = async<P extends keyof typedHypixelApi.Requests>(path
}
}
- if ('key' in options && response.headers['RateLimit-Limit']) {
+ if ('key' in options && response.headers['ratelimit-limit']) {
// remember how many uses it has
apiKeyUsage[options.key] = {
- remaining: response.headers['RateLimit-Remaining'] ?? 0,
- limit: response.headers['Ratelimit-Limit'] ?? 0,
- reset: Date.now() + response.headers['Ratelimit-Reset'] ?? 0 * 1000 + 1000,
+ remaining: response.headers['ratelimit-remaining'] ?? 0,
+ limit: response.headers['ratelimit-limit'] ?? 0,
+ reset: Date.now() + response.headers['ratelimit-reset'] ?? 0 * 1000 + 1000,
}
let usage = apiKeyUsage[options.key].limit - apiKeyUsage[options.key].remaining