Files
Frontend/src/common/player.ts

17 lines
317 B
TypeScript
Raw Normal View History

2024-04-18 07:06:16 +01:00
import { getPlayer } from "mcutils-library";
/**
* Checks if the player is valid.
*
* @param id the player's id
* @returns true if valid, false otherwise
*/
export async function isValidPlayer(id: string): Promise<boolean> {
try {
await getPlayer(id);
return true;
} catch {
2024-04-18 08:54:13 +01:00
return false;
2024-04-18 07:06:16 +01:00
}
}