Added nicer output
This commit is contained in:
@@ -45,8 +45,14 @@ module.exports = {
|
|||||||
const userCheck = await fetch(mojang + ign);
|
const userCheck = await fetch(mojang + ign);
|
||||||
const userUUID = userCheck.data.id;
|
const userUUID = userCheck.data.id;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fetch(slothPixel + userUUID);
|
||||||
|
} catch (error) {
|
||||||
|
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const stats = await fetch(slothPixel + userUUID);
|
const stats = await fetch(slothPixel + userUUID);
|
||||||
const guildCheck = guildAPI + userUUID
|
|
||||||
const head = minotar + ign;
|
const head = minotar + ign;
|
||||||
|
|
||||||
if (!stats.data.uuid) {
|
if (!stats.data.uuid) {
|
||||||
@@ -54,6 +60,15 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rank_formatted = stats.data.rank_formatted
|
||||||
|
const rank2 = rank_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||||
|
|
||||||
|
if (rank2 === "") {
|
||||||
|
var rank = ""
|
||||||
|
} else {
|
||||||
|
var rank = rank2 + " "
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const guildCheck = await fetch(guildAPI + userUUID);
|
const guildCheck = await fetch(guildAPI + userUUID);
|
||||||
var guildName = guildCheck.data.name
|
var guildName = guildCheck.data.name
|
||||||
@@ -85,9 +100,18 @@ module.exports = {
|
|||||||
var duelstitle = "This player meets the Duels requirements."
|
var duelstitle = "This player meets the Duels requirements."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const guildCheck = await fetch(guildAPI + userUUID);
|
||||||
|
const tag_formatted = guildCheck.data.tag_formatted
|
||||||
|
const guildTag2 = tag_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||||
|
var guildTag = " " + guildTag2
|
||||||
|
} catch (error) {
|
||||||
|
var guildTag = ""
|
||||||
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: stats.data.username,
|
title: rank + stats.data.username + guildTag,
|
||||||
description: "**Network Level:** `" + stats.data.level.toString() + "`\n" +
|
description: "**Network Level:** `" + stats.data.level.toString() + "`\n" +
|
||||||
"**Current Guild:** `" + guildName + "`",
|
"**Current Guild:** `" + guildName + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
|||||||
@@ -32,9 +32,25 @@ module.exports = {
|
|||||||
const userCheck = await fetch(mojang + uuid);
|
const userCheck = await fetch(mojang + uuid);
|
||||||
const ign = userCheck.data.name;
|
const ign = userCheck.data.name;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await fetch(slothPixel + uuid);
|
||||||
|
} catch (error) {
|
||||||
|
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const stats = await fetch(slothPixel + uuid);
|
const stats = await fetch(slothPixel + uuid);
|
||||||
const head = minotar + ign;
|
const head = minotar + ign;
|
||||||
|
|
||||||
|
const rank_formatted = stats.data.rank_formatted
|
||||||
|
const rank2 = rank_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||||
|
|
||||||
|
if (rank2 === "") {
|
||||||
|
var rank = ""
|
||||||
|
} else {
|
||||||
|
var rank = rank2 + " "
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const guildCheck = await fetch(guildAPI + uuid);
|
const guildCheck = await fetch(guildAPI + uuid);
|
||||||
var guildName = guildCheck.data.name
|
var guildName = guildCheck.data.name
|
||||||
@@ -66,9 +82,18 @@ module.exports = {
|
|||||||
var duelstitle = "This player meets the Duels requirements."
|
var duelstitle = "This player meets the Duels requirements."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const guildCheck = await fetch(guildAPI + userUUID);
|
||||||
|
const tag_formatted = guildCheck.data.tag_formatted
|
||||||
|
const guildTag2 = tag_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||||
|
var guildTag = " " + guildTag2
|
||||||
|
} catch (error) {
|
||||||
|
var guildTag = ""
|
||||||
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: stats.data.username,
|
title: rank + stats.data.username + guildTag,
|
||||||
description: "**Network Level:** `" + stats.data.level.toString() + "`\n" +
|
description: "**Network Level:** `" + stats.data.level.toString() + "`\n" +
|
||||||
"**Current Guild:** `" + guildName + "`",
|
"**Current Guild:** `" + guildName + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
|||||||
Reference in New Issue
Block a user