aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/extensions/Util.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lib/extensions/Util.ts b/src/lib/extensions/Util.ts
index 4942bb8..771876b 100644
--- a/src/lib/extensions/Util.ts
+++ b/src/lib/extensions/Util.ts
@@ -12,6 +12,29 @@ interface hastebinRes {
key: string;
}
+export interface uuidRes {
+ uuid: string;
+ username: string;
+ username_history?:
+ | {
+ username: string;
+ }[]
+ | null;
+ textures: {
+ custom: boolean;
+ slim: boolean;
+ skin: {
+ url: string;
+ data: string;
+ };
+ raw: {
+ value: string;
+ signature: string;
+ };
+ };
+ created_at: string;
+}
+
export class Util extends ClientUtil {
/**
* The client of this ClientUtil
@@ -241,4 +264,11 @@ export class Util extends ClientUtil {
if (color) embed = embed.setColor(color);
return embed;
}
+
+ public async mcUUID(username: string): Promise<string> {
+ const apiRes = (await got
+ .get(`https://api.ashcon.app/mojang/v2/user/${username}`)
+ .json()) as uuidRes;
+ return apiRes.uuid;
+ }
}