From 0c9b240feb0ff4a8f60e43f6424fbe0a6e7a1887 Mon Sep 17 00:00:00 2001 From: Taken Date: Sat, 8 Apr 2023 14:33:28 +0200 Subject: [PATCH] Adding first support for functions --- commands/check.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/commands/check.js b/commands/check.js index dc85588..6682f3f 100644 --- a/commands/check.js +++ b/commands/check.js @@ -1,5 +1,6 @@ const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require('discord.js'); const { bwfdkr, bwstars, bwwins, duelswins, swstars } = require('../config/reqs.json') +const getuuid = require('../utils/functions'); const env = require('dotenv').config(); const hypixelApiKey = process.env.HYPIXELAPI; const { color } = require('../config/options.json'); @@ -36,15 +37,12 @@ module.exports = { return } - try { - await fetch(mojang + ign); - } catch (error) { - interaction.editReply('That player doesn\'t exist. [Mojang]') + if (await getuuid(ign) === null) { + await interaction.editReply('That player doesn\'t exist. [Mojang]') return } - const userCheck = await fetch(mojang + ign); - const userUUID = userCheck.data.id; + const userUUID = await getuuid(ign); try { await fetch(slothPixel + userUUID);