aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock
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/cleaners/skyblock
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/cleaners/skyblock')
-rw-r--r--src/cleaners/skyblock/member.ts12
1 files changed, 9 insertions, 3 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,