aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-05-24 18:45:35 -0500
committermat <github@matdoes.dev>2021-05-24 18:45:35 -0500
commitee30474985ca2556f931e4ffd5e3643048bea1c5 (patch)
tree381e59c2b8e5c50bf0109cb9d1c01d0b611615bf /src
parentda55f893ef3ea3c55816d36e63f11fe6509ce843 (diff)
downloadskyblock-api-ee30474985ca2556f931e4ffd5e3643048bea1c5.tar.gz
skyblock-api-ee30474985ca2556f931e4ffd5e3643048bea1c5.tar.bz2
skyblock-api-ee30474985ca2556f931e4ffd5e3643048bea1c5.zip
remove first_join from CleanPlayer
we *probably* don't need it
Diffstat (limited to 'src')
-rw-r--r--src/cleaners/player.ts4
-rw-r--r--src/hypixelCached.ts4
2 files changed, 6 insertions, 2 deletions
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)