aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/member.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-09 13:19:20 -0500
committermat <github@matdoes.dev>2022-04-09 13:19:20 -0500
commit3d4d9e51880aa665541e335bcd5dfa8c9bce2299 (patch)
tree97670a92bf1e41160c53458621bc65454bcbd0a8 /src/cleaners/skyblock/member.ts
parentaca2096adb2568c4c19fff96c293aa9a625002be (diff)
downloadskyblock-api-3d4d9e51880aa665541e335bcd5dfa8c9bce2299.tar.gz
skyblock-api-3d4d9e51880aa665541e335bcd5dfa8c9bce2299.tar.bz2
skyblock-api-3d4d9e51880aa665541e335bcd5dfa8c9bce2299.zip
return whole player in coopInvitation
Diffstat (limited to 'src/cleaners/skyblock/member.ts')
-rw-r--r--src/cleaners/skyblock/member.ts22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts
index 9306c59..9231456 100644
--- a/src/cleaners/skyblock/member.ts
+++ b/src/cleaners/skyblock/member.ts
@@ -72,6 +72,14 @@ export async function cleanSkyBlockProfileMemberResponse(member: typedHypixelApi
if (fairySouls.total > (maxFairySouls ?? 0))
await constants.setConstantValues({ max_fairy_souls: fairySouls.total })
+ const coopInvitationPromise = cleanCoopInvitation(member)
+ const minionsPromise = cleanMinions(member)
+ const skillsPromise = cleanSkills(member)
+ const zonesPromise = cleanVisitedZones(member)
+ const petsPromise = cleanPets(member)
+ const harpPromise = cleanHarp(member)
+ const inventoriesPromise = inventoriesIncluded ? cleanInventories(member) : Promise.resolve(undefined)
+
return {
uuid: member.uuid,
username: player.username,
@@ -87,17 +95,17 @@ export async function cleanSkyBlockProfileMemberResponse(member: typedHypixelApi
// this is used for leaderboards
rawHypixelStats: member.stats ?? {},
- minions: await cleanMinions(member),
+ minions: await minionsPromise,
fairySouls: fairySouls,
- inventories: inventoriesIncluded ? await cleanInventories(member) : undefined,
+ inventories: inventoriesPromise ? await inventoriesPromise : undefined,
objectives: cleanObjectives(member),
- skills: await cleanSkills(member),
- zones: await cleanVisitedZones(member),
+ skills: await skillsPromise,
+ zones: await zonesPromise,
collections: cleanCollections(member),
slayers: cleanSlayers(member),
- pets: await cleanPets(member),
- harp: await cleanHarp(member),
- coopInvitation: cleanCoopInvitation(member),
+ pets: await petsPromise,
+ harp: await harpPromise,
+ coopInvitation: await coopInvitationPromise,
farmingContests: cleanFarmingContests(member),
left: (player.profiles?.find(profile => profile.uuid === profileId) === undefined) ?? false