aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-14 19:19:36 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-14 19:19:36 -0600
commit100e863740ea4fde199f674b348dcf13a6d6ff81 (patch)
tree280e5086fb50753bc44ccfb0d33a38e95652b01f /src
parentfd2348bf16c55422ec664e6677b636998eccc71c (diff)
downloadskyblock-api-100e863740ea4fde199f674b348dcf13a6d6ff81.tar.gz
skyblock-api-100e863740ea4fde199f674b348dcf13a6d6ff81.tar.bz2
skyblock-api-100e863740ea4fde199f674b348dcf13a6d6ff81.zip
add rank to basic member
Diffstat (limited to 'src')
-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
}
})
}