From f976a112f2a4d908aa0224b48b1ac99a1452e5c5 Mon Sep 17 00:00:00 2001 From: Braydon Date: Sun, 14 Apr 2024 15:08:59 -0700 Subject: [PATCH] Update sdk/js/player/query --- sdk%2Fjs%2Fplayer%2Fquery.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk%2Fjs%2Fplayer%2Fquery.md b/sdk%2Fjs%2Fplayer%2Fquery.md index 7a90501..c2ebf88 100644 --- a/sdk%2Fjs%2Fplayer%2Fquery.md +++ b/sdk%2Fjs%2Fplayer%2Fquery.md @@ -5,6 +5,12 @@ import { CachedPlayer } from "restfulmc-lib"; import { getPlayer } from "restfulmc-lib"; -const player: CachedPlayer = await getPlayer("Username or UUID"); -console.log(`Hello ${player.username}, your UUID is ${player.uniqueId}!`); +try { + const player: CachedPlayer = await getPlayer("Rainnny"); + console.log(`Hello ${player.username}, your UUID is ${player.uniqueId}!`); +} catch (err) { + if ((err as ErrorResponse).code == 404) { + console.error("Player with UUID or username not found."); + } +} ``` \ No newline at end of file