From 0e5887326f1ba1f8005ca0bd217c5b332a1fb6cf Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Wed, 14 Apr 2021 20:23:59 -0500 Subject: 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 --- src/hypixelApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hypixelApi.ts') 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 { // 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 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 }) -- cgit