aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-12-28 19:32:10 -0600
committermat <github@matdoes.dev>2021-12-28 19:32:10 -0600
commit3703a3b53efae8e1f3de0029f2d1d5499fdc0fdd (patch)
treeced5aa945f31a40259fcb8c625c53742a058db76 /src
parent20800161a5d70b01a8d9a0345c985c75c5865219 (diff)
downloadskyblock-api-3703a3b53efae8e1f3de0029f2d1d5499fdc0fdd.tar.gz
skyblock-api-3703a3b53efae8e1f3de0029f2d1d5499fdc0fdd.tar.bz2
skyblock-api-3703a3b53efae8e1f3de0029f2d1d5499fdc0fdd.zip
fix issue with api key
Diffstat (limited to 'src')
-rw-r--r--src/hypixelApi.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts
index d39b155..9a0a6da 100644
--- a/src/hypixelApi.ts
+++ b/src/hypixelApi.ts
@@ -36,7 +36,8 @@ export function chooseApiKey(): string | null {
// find the api key with the lowest amount of uses
let bestKeyUsage: KeyUsage | null = null
let bestKey: string | null = null
- for (let key of shuffle(apiKeys.slice())) {
+ // we limit to 5 api keys because otherwise they get automatically banned
+ for (let key of shuffle(apiKeys.slice(0, 5))) {
const keyUsage = apiKeyUsage[key]
// if the key has never been used before, use it