aboutsummaryrefslogtreecommitdiff
path: root/build/hypixel.js
diff options
context:
space:
mode:
authormat-1 <github@matdoes.dev>2021-02-15 01:35:32 +0000
committermat-1 <github@matdoes.dev>2021-02-15 01:35:32 +0000
commit84778bb94747390fbcc83a3d6a5bd69286208f61 (patch)
treecd515d0a8c51b0f343611fd78db7d08f34456c0b /build/hypixel.js
parent342d11858b4db9981a23a27dfb28e18d18a4c2fa (diff)
downloadskyblock-api-84778bb94747390fbcc83a3d6a5bd69286208f61.tar.gz
skyblock-api-84778bb94747390fbcc83a3d6a5bd69286208f61.tar.bz2
skyblock-api-84778bb94747390fbcc83a3d6a5bd69286208f61.zip
Compiled TS into JS
Diffstat (limited to 'build/hypixel.js')
-rw-r--r--build/hypixel.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/build/hypixel.js b/build/hypixel.js
index 5c6ce4c..91ec025 100644
--- a/build/hypixel.js
+++ b/build/hypixel.js
@@ -107,6 +107,9 @@ exports.fetchUser = fetchUser;
async function fetchMemberProfile(user, profile) {
const playerUuid = await cached.uuidFromUser(user);
const profileUuid = await cached.fetchProfileUuid(user, profile);
+ // if the profile doesn't have an id, just return
+ if (!profileUuid)
+ return null;
const player = await cached.fetchPlayer(playerUuid);
const cleanProfile = await cached.fetchProfile(playerUuid, profileUuid);
const member = cleanProfile.members.find(m => m.uuid === playerUuid);
@@ -117,6 +120,7 @@ async function fetchMemberProfile(user, profile) {
username: m.username,
first_join: m.first_join,
last_save: m.last_save,
+ rank: m.rank
};
});
cleanProfile.members = simpleMembers;