aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cleaners/skyblock/member.ts12
-rw-r--r--src/hypixel.ts1
-rw-r--r--src/hypixelCached.ts3
3 files changed, 12 insertions, 4 deletions
diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts
index a6bb4c5..41db716 100644
--- a/src/cleaners/skyblock/member.ts
+++ b/src/cleaners/skyblock/member.ts
@@ -12,12 +12,14 @@ import { Bank } from './bank'
import { cleanVisitedZones, Zone } from './zones'
import { cleanCollections, Collection } from './collections'
import { cleanSlayers, SlayerData } from './slayers'
+import { cleanRank, CleanRank } from '../rank'
export interface CleanBasicMember {
uuid: string
username: string
last_save: number
first_join: number
+ rank: CleanRank
}
export interface CleanMember extends CleanBasicMember {
@@ -33,12 +35,14 @@ export interface CleanMember extends CleanBasicMember {
slayers: SlayerData
}
-export async function cleanSkyBlockProfileMemberResponseBasic(member, included: Included[] = null): Promise<CleanBasicMember> {
+export async function cleanSkyBlockProfileMemberResponseBasic(member: any, included: Included[] = null): Promise<CleanBasicMember> {
+ const player = await cached.fetchPlayer(member.uuid)
return {
uuid: member.uuid,
- username: await cached.usernameFromUser(member.uuid),
+ username: player.username,
last_save: member.last_save,
first_join: member.first_join,
+ rank: player.rank
}
}
@@ -46,11 +50,13 @@ export async function cleanSkyBlockProfileMemberResponseBasic(member, included:
export async function cleanSkyBlockProfileMemberResponse(member, included: Included[] = null): Promise<CleanMember> {
// profiles.members[]
const inventoriesIncluded = included == null || included.includes('inventories')
+ const player = await cached.fetchPlayer(member.uuid)
return {
uuid: member.uuid,
- username: await cached.usernameFromUser(member.uuid),
+ username: player.username,
last_save: member.last_save,
first_join: member.first_join,
+ rank: player.rank,
purse: member.coin_purse,
diff --git a/src/hypixel.ts b/src/hypixel.ts
index 395748a..f3e1491 100644
--- a/src/hypixel.ts
+++ b/src/hypixel.ts
@@ -142,6 +142,7 @@ export async function fetchMemberProfile(user: string, profile: string): Promise
username: m.username,
first_join: m.first_join,
last_save: m.last_save,
+ rank: m.rank
}
})
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts
index 35f1cbb..1125aa8 100644
--- a/src/hypixelCached.ts
+++ b/src/hypixelCached.ts
@@ -139,7 +139,8 @@ export async function fetchSkyblockProfiles(playerUuid: string): Promise<CleanPr
uuid: m.uuid,
username: m.username,
first_join: m.first_join,
- last_save: m.last_save
+ last_save: m.last_save,
+ rank: m.rank
}
})
}