diff options
-rw-r--r-- | build/cleaners/player.js | 2 | ||||
-rw-r--r-- | build/hypixelCached.js | 4 | ||||
-rw-r--r-- | src/cleaners/player.ts | 4 | ||||
-rw-r--r-- | src/hypixelCached.ts | 4 |
4 files changed, 11 insertions, 3 deletions
diff --git a/build/cleaners/player.js b/build/cleaners/player.js index 4957e7a..dadb129 100644 --- a/build/cleaners/player.js +++ b/build/cleaners/player.js @@ -15,7 +15,7 @@ async function cleanPlayerResponse(data) { username: data.displayname, rank: rank_1.cleanRank(data), socials: socialmedia_1.cleanSocialMedia(data), - first_join: data.firstLogin / 1000, + // first_join: data.firstLogin / 1000, profiles: profiles_1.cleanPlayerSkyblockProfiles((_b = (_a = data.stats) === null || _a === void 0 ? void 0 : _a.SkyBlock) === null || _b === void 0 ? void 0 : _b.profiles) }; } diff --git a/build/hypixelCached.js b/build/hypixelCached.js index fcdfcf9..8dac057 100644 --- a/build/hypixelCached.js +++ b/build/hypixelCached.js @@ -231,6 +231,10 @@ async function fetchBasicProfiles(user) { if (_1.debug) console.debug('Cache miss: fetchBasicProfiles', user); const player = await fetchPlayer(playerUuid); + if (!player) { + console.log('bruh playerUuid', playerUuid); + return []; + } const profiles = player.profiles; exports.basicProfilesCache.set(playerUuid, profiles); // cache the profile names and uuids to profileNameCache because we can diff --git a/src/cleaners/player.ts b/src/cleaners/player.ts index fb8af78..6ac1382 100644 --- a/src/cleaners/player.ts +++ b/src/cleaners/player.ts @@ -14,7 +14,7 @@ export interface CleanPlayer extends CleanBasicPlayer { rank: CleanRank socials: CleanSocialMedia profiles?: CleanBasicProfile[] - first_join: number + // first_join?: number } export async function cleanPlayerResponse(data: HypixelPlayer): Promise<CleanPlayer> { @@ -26,7 +26,7 @@ export async function cleanPlayerResponse(data: HypixelPlayer): Promise<CleanPla username: data.displayname, rank: cleanRank(data), socials: cleanSocialMedia(data), - first_join: data.firstLogin / 1000, + // first_join: data.firstLogin / 1000, profiles: cleanPlayerSkyblockProfiles(data.stats?.SkyBlock?.profiles) } } diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index c14db3e..1f6b7f2 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -247,6 +247,10 @@ async function fetchBasicProfiles(user: string): Promise<CleanBasicProfile[]> { if (debug) console.debug('Cache miss: fetchBasicProfiles', user) const player = await fetchPlayer(playerUuid) + if (!player) { + console.log('bruh playerUuid', playerUuid) + return [] + } const profiles = player.profiles basicProfilesCache.set(playerUuid, profiles) |