diff options
author | mat <github@matdoes.dev> | 2022-05-20 20:35:39 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-05-20 20:35:39 -0500 |
commit | 3ee66da4a46138d00208f6ba65aedc999e2b4237 (patch) | |
tree | 891f6b91da9dcee3b30f579e83241d133d7cf0fe /src/cleaners/achievements.ts | |
parent | 77416b1a87cb76bcc10b311ccb8c874642ebfe21 (diff) | |
download | skyblock-api-3ee66da4a46138d00208f6ba65aedc999e2b4237.tar.gz skyblock-api-3ee66da4a46138d00208f6ba65aedc999e2b4237.tar.bz2 skyblock-api-3ee66da4a46138d00208f6ba65aedc999e2b4237.zip |
Fix achievements
Diffstat (limited to 'src/cleaners/achievements.ts')
-rw-r--r-- | src/cleaners/achievements.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cleaners/achievements.ts b/src/cleaners/achievements.ts index 372ab77..3e4189a 100644 --- a/src/cleaners/achievements.ts +++ b/src/cleaners/achievements.ts @@ -4,7 +4,7 @@ import { fetchAchievements } from '../hypixelCached.js' interface TieredAchievement { id: string name: string - value?: number + value: number | null description: string } @@ -29,7 +29,7 @@ export async function cleanPlayerAchievements(data: typedHypixelApi.PlayerDataRe let tieredAchievements: TieredAchievement[] = [] for (const [achievementId, achievementData] of Object.entries(achievementsData.tiered)) { - const value = data.achievements[`skyblock_${achievementId}`] ?? undefined + const value = data.achievements[`skyblock_${achievementId.toLowerCase()}`] ?? null tieredAchievements.push({ id: achievementId.toLowerCase(), name: achievementData.name, @@ -43,7 +43,7 @@ export async function cleanPlayerAchievements(data: typedHypixelApi.PlayerDataRe oneTimeAchievements.push({ id: achievementId.toLowerCase(), name: achievementData.name, - achieved: data.achievementsOneTime.includes(`skyblock_${achievementId}`), + achieved: data.achievementsOneTime.includes(`skyblock_${achievementId.toLowerCase()}`), description: achievementData.description }) } |