blob: 214be1f5ff00dbfb80be336741123732ac4a0a31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import { cleanPlayerSkyblockProfiles } from './skyblock/profiles.js';
import { cleanSocialMedia } from './socialmedia.js';
import { cleanRank } from './rank.js';
import { undashUuid } from '../util.js';
export async function cleanPlayerResponse(data) {
// Cleans up a 'player' api response
if (!data)
return null; // bruh
return {
uuid: undashUuid(data.uuid),
username: data.displayname,
rank: cleanRank(data),
socials: cleanSocialMedia(data),
// first_join: data.firstLogin / 1000,
profiles: cleanPlayerSkyblockProfiles(data.stats?.SkyBlock?.profiles)
};
}
|