From 2ef1219194811e5732b6234bd98c531e1eb77dc5 Mon Sep 17 00:00:00 2001 From: TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> Date: Tue, 11 May 2021 10:47:03 -0600 Subject: add capeperms command --- src/lib/extensions/Util.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/lib') 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 { + const apiRes = (await got + .get(`https://api.ashcon.app/mojang/v2/user/${username}`) + .json()) as uuidRes; + return apiRes.uuid; + } } -- cgit