diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-15 14:44:52 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-15 14:44:52 -0600 |
commit | 17c9057a71b3bdd2ea458b050ed77dfb4aebe25a (patch) | |
tree | fcaf9311b722d88797ffe975d260844aecf7ac9b /src/hypixelCached.ts | |
parent | 839b43b1cfc0735e002211326246c058e5ec759b (diff) | |
download | skyblock-api-17c9057a71b3bdd2ea458b050ed77dfb4aebe25a.tar.gz skyblock-api-17c9057a71b3bdd2ea458b050ed77dfb4aebe25a.tar.bz2 skyblock-api-17c9057a71b3bdd2ea458b050ed77dfb4aebe25a.zip |
fix profiles for players that changed their usernames
Diffstat (limited to 'src/hypixelCached.ts')
-rw-r--r-- | src/hypixelCached.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index 056f50e..ae544a2 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -65,6 +65,7 @@ export async function uuidFromUser(user: string): Promise<string> { // not cached, actually fetch mojang api now let { uuid, username } = await mojang.mojangDataFromUser(user) + if (!uuid) return // remove dashes from the uuid so its more normal uuid = undashUuid(uuid) @@ -103,6 +104,7 @@ export async function fetchPlayer(user: string): Promise<CleanPlayer> { // clone in case it gets modified somehow later const cleanPlayerClone = Object.assign({}, cleanPlayer) playerCache.set(playerUuid, cleanPlayerClone) + usernameCache.set(playerUuid, cleanPlayerClone.username) return cleanPlayer } |