diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-04-14 20:23:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 20:23:59 -0500 |
commit | 0e5887326f1ba1f8005ca0bd217c5b332a1fb6cf (patch) | |
tree | d59cc024e2cf845b7bb044760a907da799989829 /src/hypixelApi.ts | |
parent | d5554e51b51ed69bfb60a21723652e11c06fe7eb (diff) | |
download | skyblock-api-0e5887326f1ba1f8005ca0bd217c5b332a1fb6cf.tar.gz skyblock-api-0e5887326f1ba1f8005ca0bd217c5b332a1fb6cf.tar.bz2 skyblock-api-0e5887326f1ba1f8005ca0bd217c5b332a1fb6cf.zip |
Total leaderboards leaderboard (#5)
* add leaderboards leaderboard
* slightly optimize fetchPlayer to not unnecessarily fetch the same player twice
* Compiled TS into JS
* fix errors with fetch
Diffstat (limited to 'src/hypixelApi.ts')
-rw-r--r-- | src/hypixelApi.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts index 8541089..7ee7eca 100644 --- a/src/hypixelApi.ts +++ b/src/hypixelApi.ts @@ -125,7 +125,6 @@ export interface HypixelPlayer { socialMedia?: HypixelPlayerSocialMedia } - /** Send an HTTP request to the Hypixel API */ export async function sendApiRequest({ path, key, args }): Promise<HypixelResponse> { // Send a raw http request to api.hypixel.net, and return the parsed json @@ -145,6 +144,7 @@ export async function sendApiRequest({ path, key, args }): Promise<HypixelRespon { agent: () => httpsAgent } ) } catch { + console.log('error in fetch :/') // if there's an error, wait a second and try again await new Promise((resolve) => setTimeout(resolve, 1000)) return await sendApiRequest({ path, key, args }) |