diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 20:11:53 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-02-13 20:11:53 -0600 |
commit | cd707234194b41df933a3a287b5fbec3657063d5 (patch) | |
tree | 22115a93afcba5b268fbeb9d69b7e1fa8ed95fa6 /src/cleaners/skyblock/member.ts | |
parent | 9b2856303374521b315759500cf594ec7f22d293 (diff) | |
download | skyblock-api-cd707234194b41df933a3a287b5fbec3657063d5.tar.gz skyblock-api-cd707234194b41df933a3a287b5fbec3657063d5.tar.bz2 skyblock-api-cd707234194b41df933a3a287b5fbec3657063d5.zip |
add objectives and skills
Diffstat (limited to 'src/cleaners/skyblock/member.ts')
-rw-r--r-- | src/cleaners/skyblock/member.ts | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts index d7d0cd1..04aa476 100644 --- a/src/cleaners/skyblock/member.ts +++ b/src/cleaners/skyblock/member.ts @@ -5,6 +5,7 @@ import { Bank } from './bank' import { cleanFairySouls, FairySouls } from './fairysouls' import { cleanInventories, INVENTORIES } from './inventory' import { CleanMinion, cleanMinions } from './minions' +import { cleanObjectives, Objective } from './objectives' import { CleanFullProfile } from './profile' import { CleanProfileStats, cleanProfileStats } from './stats' @@ -16,29 +17,38 @@ export interface CleanBasicMember { } export interface CleanMember extends CleanBasicMember { - stats?: CleanProfileStats - minions?: CleanMinion[] - bank?: Bank - fairy_souls?: FairySouls + stats: CleanProfileStats + minions: CleanMinion[] + fairy_souls: FairySouls inventories: typeof INVENTORIES + objectives: Objective[] } +export async function cleanSkyBlockProfileMemberResponseBasic(member, included: Included[] = null): Promise<CleanBasicMember> { + return { + uuid: member.uuid, + username: await cached.usernameFromUser(member.uuid), + last_save: member.last_save, + first_join: member.first_join, + } +} /** Cleans up a member (from skyblock/profile) */ export async function cleanSkyBlockProfileMemberResponse(member, included: Included[] = null): Promise<CleanMember> { // profiles.members[] - const statsIncluded = included == null || included.includes('stats') const inventoriesIncluded = included == null || included.includes('inventories') return { uuid: member.uuid, username: await cached.usernameFromUser(member.uuid), last_save: member.last_save, first_join: member.first_join, - // last_death: ??? idk how this is formatted, - stats: statsIncluded ? cleanProfileStats(member?.stats) : undefined, - minions: statsIncluded ? cleanMinions(member) : undefined, - fairy_souls: statsIncluded ? cleanFairySouls(member) : undefined, - inventories: inventoriesIncluded ? await cleanInventories(member) : undefined, + + stats: cleanProfileStats(member), + minions: cleanMinions(member), + fairy_souls: cleanFairySouls(member), + inventories: inventoriesIncluded ? await cleanInventories(member) : undefined, + objectives: cleanObjectives(member), + // skills: statsIncluded ? } } |