diff options
author | mat <github@matdoes.dev> | 2022-03-25 21:13:13 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-25 21:13:13 -0500 |
commit | 6b94d0110a52a355758432ff6cd14c80553471ea (patch) | |
tree | 8113e5ee126b56f2d7e31309b5fa1fd65d008a77 /src/cleaners/rank.ts | |
parent | 7f4e9c598d4697e63602bc36f9034610cac84604 (diff) | |
download | skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.tar.gz skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.tar.bz2 skyblock-api-6b94d0110a52a355758432ff6cd14c80553471ea.zip |
Add typed-hypixel-api as a dep and change some code
Diffstat (limited to 'src/cleaners/rank.ts')
-rw-r--r-- | src/cleaners/rank.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cleaners/rank.ts b/src/cleaners/rank.ts index 417c8f1..ea7579e 100644 --- a/src/cleaners/rank.ts +++ b/src/cleaners/rank.ts @@ -1,7 +1,7 @@ +import { PlayerDataResponse as HypixelApiPlayerDataResponse } from 'typed-hypixel-api/build/responses/player' import { colorCodeFromName, minecraftColorCodes } from '../util.js' -import { HypixelPlayer } from '../hypixelApi.js' -const rankColors: { [ name: string ]: string } = { +const rankColors: { [name: string]: string } = { 'NONE': '7', 'VIP': 'a', 'VIP+': 'a', @@ -29,7 +29,7 @@ export function cleanRank({ rankPlusColor, rank, prefix -}: HypixelPlayer): CleanRank { +}: HypixelApiPlayerDataResponse['player']): CleanRank { let name: string | undefined let color: string let colored: string @@ -48,7 +48,7 @@ export function cleanRank({ ?? packageRank?.replace('_PLUS', '+') switch (name) { - // MVP++ is called Superstar for some reason + // MVP++ is called Superstar for some reason case 'SUPERSTAR': name = 'MVP++' break @@ -87,7 +87,7 @@ export function cleanRank({ if (bracketColor) colored = `§${bracketColor}[${rankColorPrefix}${name}§${bracketColor}]` else - colored = `${rankColorPrefix}[${name}]` + colored = `${rankColorPrefix}[${name}]` else // nons don't have a prefix colored = `${rankColorPrefix}` |