diff options
author | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 10:47:03 -0600 |
---|---|---|
committer | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 10:47:03 -0600 |
commit | 2ef1219194811e5732b6234bd98c531e1eb77dc5 (patch) | |
tree | 431d7fd81a9076907a89e8dd2eb6bddba0030583 /src/lib | |
parent | 062e6c37c396456caa25c9aa84083800600128d1 (diff) | |
download | tanzanite-2ef1219194811e5732b6234bd98c531e1eb77dc5.tar.gz tanzanite-2ef1219194811e5732b6234bd98c531e1eb77dc5.tar.bz2 tanzanite-2ef1219194811e5732b6234bd98c531e1eb77dc5.zip |
add capeperms command
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/extensions/Util.ts | 30 |
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; + } } |