mirror of
https://gitlab.com/cyclane/sbdatatracker.git
synced 2025-04-19 12:25:05 +00:00
17 lines
495 B
TypeScript
17 lines
495 B
TypeScript
import { getOnlineStatus, getProfileByUUID } from "./lib/hypixel";
|
|
|
|
export async function log(key: string, profile: string) {
|
|
let r = await getProfileByUUID(key, profile);
|
|
if (!r.success || !r.profile) throw new Error("No success from Hypixel");
|
|
|
|
let d = r.profile;
|
|
for (const member in d.members) {
|
|
let onlineStatus = await getOnlineStatus(key, member);
|
|
if (onlineStatus.success && onlineStatus.session) {
|
|
d.members[member].online_status = onlineStatus.session;
|
|
}
|
|
}
|
|
|
|
return d;
|
|
}
|