Added eslintrc config and updated all files to it
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require("../config/reqs.json");
|
||||
const { color } = require("../config/options.json");
|
||||
const { hypixelLevel, bedwarsLevel, skywarsLevel, getUUID, getPlayer, getGuild, getHeadURL } = require("../utils/utils.js");
|
||||
const { SlashCommandBuilder } = require("discord.js")
|
||||
const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require("../config/reqs.json")
|
||||
const { color } = require("../config/options.json")
|
||||
const { hypixelLevel, bedwarsLevel, skywarsLevel, getUUID, getPlayer, getGuild, getHeadURL } = require("../utils/utils.js")
|
||||
|
||||
module.exports = {
|
||||
name: "check",
|
||||
@@ -20,27 +20,27 @@ module.exports = {
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply({});
|
||||
await interaction.deferReply({})
|
||||
|
||||
const ign = interaction.options.getString("ign");
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const ign = interaction.options.getString("ign")
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (!ign) {
|
||||
await interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
await interaction.editReply("Please provide a player's IGN.")
|
||||
return
|
||||
}
|
||||
|
||||
const uuid = await getUUID(ign);
|
||||
const uuid = await getUUID(ign)
|
||||
if (!uuid) {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{ description: "That player doesn't exist.", color: embedColor }
|
||||
]
|
||||
});
|
||||
return;
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const head = await getHeadURL(ign);
|
||||
const head = await getHeadURL(ign)
|
||||
const player = await getPlayer(uuid)
|
||||
if (!player) {
|
||||
interaction.editReply({
|
||||
@@ -48,32 +48,32 @@ module.exports = {
|
||||
description: "That player hasn't played Hypixel before.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const rank2 = player.newPackageRank;
|
||||
const monthlyRank = player.monthlyPackageRank;
|
||||
const rank2 = player.newPackageRank
|
||||
const monthlyRank = player.monthlyPackageRank
|
||||
|
||||
let rank = ""
|
||||
if (rank2 === 'VIP') {
|
||||
if (rank2 === "VIP") {
|
||||
rank = "[VIP] "
|
||||
} else if (rank2 === 'VIP_PLUS') {
|
||||
} else if (rank2 === "VIP_PLUS") {
|
||||
rank = "[VIP+] "
|
||||
} else if (rank2 === 'MVP') {
|
||||
} else if (rank2 === "MVP") {
|
||||
rank = "[MVP] "
|
||||
} else if (rank2 === 'MVP_PLUS' && monthlyRank === 'NONE') {
|
||||
} else if (rank2 === "MVP_PLUS" && monthlyRank === "NONE") {
|
||||
rank = "[MVP+] "
|
||||
} else if (rank2 === 'MVP_PLUS' && monthlyRank === 'SUPERSTAR') {
|
||||
} else if (rank2 === "MVP_PLUS" && monthlyRank === "SUPERSTAR") {
|
||||
rank = "[MVP++] "
|
||||
}
|
||||
|
||||
const guild = await getGuild(uuid)
|
||||
let guildName = ""
|
||||
if (!guild) {
|
||||
guildName = "None";
|
||||
guildName = "None"
|
||||
} else {
|
||||
guildName = guild.name;
|
||||
guildName = guild.name
|
||||
}
|
||||
|
||||
let guildTag = ""
|
||||
@@ -86,61 +86,61 @@ module.exports = {
|
||||
}
|
||||
|
||||
//bedwars level
|
||||
const hsbwexp = player.stats.Bedwars.Experience;
|
||||
const hsbwstars = bedwarsLevel(hsbwexp);
|
||||
const hsbwexp = player.stats.Bedwars.Experience
|
||||
const hsbwstars = bedwarsLevel(hsbwexp)
|
||||
// bedwars fkdr
|
||||
const hsbwfk = player.stats.Bedwars.final_kills_bedwars;
|
||||
const hsbwfd = player.stats.Bedwars.final_deaths_bedwars;
|
||||
const hsbwfkdr = hsbwfk / hsbwfd;
|
||||
const hsbwfk = player.stats.Bedwars.final_kills_bedwars
|
||||
const hsbwfd = player.stats.Bedwars.final_deaths_bedwars
|
||||
const hsbwfkdr = hsbwfk / hsbwfd
|
||||
// bedwars wins
|
||||
const hsbwwins = player.stats.Bedwars.wins_bedwars;
|
||||
const hsbwwins = player.stats.Bedwars.wins_bedwars
|
||||
// skywars level
|
||||
const hsswexp = player.stats.SkyWars.skywars_experience;
|
||||
const hsswstars = skywarsLevel(hsswexp);
|
||||
const hsswexp = player.stats.SkyWars.skywars_experience
|
||||
const hsswstars = skywarsLevel(hsswexp)
|
||||
// skywars kdr
|
||||
const hsswkills = player.stats.SkyWars.kills;
|
||||
const hsswdeaths = player.stats.SkyWars.deaths;
|
||||
const hsswkd = hsswkills / hsswdeaths;
|
||||
const hsswkills = player.stats.SkyWars.kills
|
||||
const hsswdeaths = player.stats.SkyWars.deaths
|
||||
const hsswkd = hsswkills / hsswdeaths
|
||||
//skywars wins
|
||||
const hsswwins = player.stats.SkyWars.wins;
|
||||
const hsswwins = player.stats.SkyWars.wins
|
||||
// dueks kdr
|
||||
const hsduelskills = player.stats.Duels.kills
|
||||
const hsduelsdeaths = player.stats.Duels.deaths
|
||||
const hsduelskd = hsduelskills / hsduelsdeaths
|
||||
// duels wins
|
||||
const hsduelswins = player.stats.Duels.wins;
|
||||
const hsduelswins = player.stats.Duels.wins
|
||||
// duels wlr
|
||||
const hsduelslosses = player.stats.Duels.losses;
|
||||
const hsduelswlr = hsduelswins / hsduelslosses;
|
||||
const hsduelslosses = player.stats.Duels.losses
|
||||
const hsduelswlr = hsduelswins / hsduelslosses
|
||||
// network level
|
||||
const hypixelExp = player.networkExp;
|
||||
const level = hypixelLevel(hypixelExp);
|
||||
const hypixelExp = player.networkExp
|
||||
const level = hypixelLevel(hypixelExp)
|
||||
|
||||
let bwtitle = ""
|
||||
let swtitle = ""
|
||||
let duelstitle = ""
|
||||
if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) {
|
||||
bwtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements.";
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
||||
} else {
|
||||
bwtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the BedWars requirements.";
|
||||
"<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
||||
}
|
||||
|
||||
if (hsswstars < swstars) {
|
||||
swtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements.";
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
||||
} else {
|
||||
swtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements.";
|
||||
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
||||
}
|
||||
|
||||
if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
|
||||
duelstitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements.";
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
||||
} else {
|
||||
duelstitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the Duels requirements.";
|
||||
"<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -195,6 +195,6 @@ module.exports = {
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user