diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cleaners/skyblock/profile.ts | 7 | ||||
-rw-r--r-- | src/hypixel.ts | 2 | ||||
-rw-r--r-- | src/hypixelCached.ts | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/cleaners/skyblock/profile.ts b/src/cleaners/skyblock/profile.ts index 48daa24..ebe5c47 100644 --- a/src/cleaners/skyblock/profile.ts +++ b/src/cleaners/skyblock/profile.ts @@ -7,7 +7,8 @@ import { Bank, cleanBank } from './bank.js' import { cleanGameMode, GameMode } from './gameMode.js' export interface CleanProfile extends CleanBasicProfile { - members?: CleanBasicMember[] + members: CleanBasicMember[] + mode: GameMode } export interface CleanFullProfile extends CleanProfile { @@ -16,7 +17,6 @@ export interface CleanFullProfile extends CleanProfile { minions: CleanMinion[] minionCount: number maxUniqueMinions: number - mode: GameMode } export interface CleanFullProfileBasicMembers extends CleanProfile { @@ -25,7 +25,6 @@ export interface CleanFullProfileBasicMembers extends CleanProfile { minions: CleanMinion[] minionCount: number maxUniqueMinions: number - mode: GameMode } /** Return a `CleanProfile` instead of a `CleanFullProfile`, useful when we need to get members but don't want to waste much ram */ @@ -46,6 +45,7 @@ export async function cleanSkyblockProfileResponseLighter(data: typedHypixelApi. uuid: data.profile_id, name: 'cute_name' in data ? data.cute_name : undefined, members: cleanedMembers, + mode: cleanGameMode(data) } } @@ -83,6 +83,7 @@ export async function cleanSkyblockProfileResponse<O extends ApiOptions>( uuid: profileId, name: 'cute_name' in data ? data.cute_name : undefined, members: cleanedMembers, + mode: cleanGameMode(data) } // we have to do this because of the basic checking typing return cleanProfile as any diff --git a/src/hypixel.ts b/src/hypixel.ts index b886090..549f593 100644 --- a/src/hypixel.ts +++ b/src/hypixel.ts @@ -86,7 +86,7 @@ export interface UserAny { export interface CleanUser { player: CleanPlayer | null - profiles?: CleanProfile[] + profiles?: CleanProfile[] | CleanBasicProfile[] activeProfile?: string online?: boolean customization?: AccountCustomization diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index a2600f2..e8195fb 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -248,7 +248,8 @@ export async function fetchSkyblockProfiles(playerUuid: string): Promise<CleanPr rank: m.rank, left: m.left } - }) + }), + mode: profile.mode } basicProfiles.push(basicProfile) } @@ -381,7 +382,8 @@ export async function fetchBasicProfileFromUuid(profileUuid: string): Promise<Cl firstJoin: m.firstJoin, rank: m.rank, })), - name: profile.name + name: profile.name, + mode: profile.mode } } // TODO: cache this |