diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-04-27 20:02:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 20:02:26 -0500 |
commit | 39210646284cabc89256466646f8ea7834a78d31 (patch) | |
tree | e602e871a72681038e652907fefecf94ef82702f /build/cleaners/skyblock/profile.js | |
parent | 2b309975eec24b09dab95076c433e9392dc2e3ed (diff) | |
download | skyblock-api-39210646284cabc89256466646f8ea7834a78d31.tar.gz skyblock-api-39210646284cabc89256466646f8ea7834a78d31.tar.bz2 skyblock-api-39210646284cabc89256466646f8ea7834a78d31.zip |
Add minion_count leaderboard (#15)
* add minion count leaderboard
* fix error that happens sometimes
* Update index.js
Diffstat (limited to 'build/cleaners/skyblock/profile.js')
-rw-r--r-- | build/cleaners/skyblock/profile.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/build/cleaners/skyblock/profile.js b/build/cleaners/skyblock/profile.js index ef90ce8..ba2c030 100644 --- a/build/cleaners/skyblock/profile.js +++ b/build/cleaners/skyblock/profile.js @@ -31,9 +31,19 @@ async function cleanSkyblockProfileResponse(data, options) { for (const memberUUID in data.members) { const memberRaw = data.members[memberUUID]; memberRaw.uuid = memberUUID; - promises.push(member_1.cleanSkyBlockProfileMemberResponse(memberRaw, ['stats', (options === null || options === void 0 ? void 0 : options.mainMemberUuid) === memberUUID ? 'inventories' : undefined])); + promises.push(member_1.cleanSkyBlockProfileMemberResponse(memberRaw, [ + !(options === null || options === void 0 ? void 0 : options.basic) ? 'stats' : undefined, + (options === null || options === void 0 ? void 0 : options.mainMemberUuid) === memberUUID ? 'inventories' : undefined + ])); } const cleanedMembers = (await Promise.all(promises)).filter(m => m !== null && m !== undefined); + if (options === null || options === void 0 ? void 0 : options.basic) { + return { + uuid: data.profile_id, + name: data.cute_name, + members: cleanedMembers, + }; + } const memberMinions = []; for (const member of cleanedMembers) { memberMinions.push(member.minions); |