17 lines
316 B
TypeScript
17 lines
316 B
TypeScript
|
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 {
|
||
|
return true;
|
||
|
}
|
||
|
}
|