diff options
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 ? } } |