From d36ac507deb28fb47e26bdad6f036a17b58d3173 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 6 Aug 2023 11:21:52 +0200 Subject: [PATCH] Added duels wlr to stat check --- commands/check.js | 23 ++++++++++------------- events/buttons/checkstats.js | 20 +++++++++----------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/commands/check.js b/commands/check.js index 4e2db64..090fe48 100644 --- a/commands/check.js +++ b/commands/check.js @@ -1,7 +1,5 @@ -const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = - require("discord.js"); -const { bwfdkr, bwstars, bwwins, duelswins, swstars } = - require("../config/reqs.json"); +const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require("discord.js"); +const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require("../config/reqs.json"); const env = require("dotenv").config(); const hypixelApiKey = process.env.HYPIXELAPIKEY; const { color } = require("../config/options.json"); @@ -127,7 +125,7 @@ module.exports = { const hypixelExp = stats.data.player.networkExp; const level = getExactLevel(hypixelExp); - if (hsbwstars < bwstars || hsbwfkdr < bwfdkr || hsbwwins < bwwins) { + if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) { var bwtitle = " This player does not meet the BedWars requirements."; } else { @@ -143,7 +141,7 @@ module.exports = { " This player meets the SkyWars requirements."; } - if (hsduelswins < duelswins) { + if (hsduelswins < duelswins || hsduelswlr < duelswlr) { var duelstitle = " This player does not meet the Duels requirements."; } else { @@ -171,7 +169,7 @@ module.exports = { bwstars.toString() + "`\n" + "**➺ FKDR:** `" + hsbwfkdr.toFixed(2).toString() + - " / " + bwfdkr.toString() + "`\n" + + " / " + bwfkdr.toString() + "`\n" + "**➺ Wins:** `" + hsbwwins.toString() + " / " + bwwins.toString() + "`" @@ -193,12 +191,11 @@ module.exports = { value: "**➺ Wins:** `" + hsduelswins.toString() + " / " + duelswins.toString() + "`\n" + - "**➺ KDR:** `" + - hsduelskd.toFixed(2).toString() + - "`\n" + - "**➺ WLR:** `" + - hsduelswlr.toFixed(2).toString() + - "`" + "**➺ WLR:** `" + + hsduelswlr.toFixed(2).toString() + + " / " + duelswlr.toString() + "`\n" + + "**➺ KDR:** `" + + hsduelskd.toFixed(2).toString() + "`" } ] }] diff --git a/events/buttons/checkstats.js b/events/buttons/checkstats.js index 3b59e93..5263c1a 100644 --- a/events/buttons/checkstats.js +++ b/events/buttons/checkstats.js @@ -1,7 +1,7 @@ const { color } = require('../../config/options.json'); const fetch = require('axios'); const guildapp = require('../../schemas/guildAppSchema.js'); -const { bwfdkr, bwstars, bwwins, duelswins, swstars } = require('../../config/reqs.json'); +const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require('../../config/reqs.json'); const env = require("dotenv").config(); const hypixelApiKey = process.env.HYPIXELAPIKEY; const { getExactLevel, skywarsLevel, getLevelForExp } = require("../../utils/functions.js"); @@ -108,7 +108,7 @@ module.exports = { const hypixelExp = stats.data.player.networkExp; const level = getExactLevel(hypixelExp); - if (hsbwstars < bwstars || hsbwfkdr < bwfdkr || hsbwwins < bwwins) { + if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) { var bwtitle = " This player does not meet the BedWars requirements." } else { var bwtitle = " This player meets the BedWars requirements." @@ -120,7 +120,7 @@ module.exports = { var swtitle = " This player meets the SkyWars requirements." } - if (hsduelswins < duelswins) { + if (hsduelswins < duelswins || hsduelswlr < duelswlr) { var duelstitle = " This player does not meet the Duels requirements." } else { var duelstitle = " This player meets the Duels requirements." @@ -146,7 +146,7 @@ module.exports = { bwstars.toString() + "`\n" + "**➺ FKDR:** `" + hsbwfkdr.toFixed(2).toString() + - " / " + bwfdkr.toString() + "`\n" + + " / " + bwfkdr.toString() + "`\n" + "**➺ Wins:** `" + hsbwwins.toString() + " / " + bwwins.toString() + "`" @@ -158,8 +158,7 @@ module.exports = { hsswstars.toFixed(2).toString() + " / " + swstars.toString() + "`\n" + "**➺ KDR:** `" + - hsswkd.toFixed(2).toString() + - "`\n" + + hsswkd.toFixed(2).toString() + "`\n" + "**➺ Wins:** `" + hsswwins.toString() + "`" }, @@ -168,12 +167,11 @@ module.exports = { value: "**➺ Wins:** `" + hsduelswins.toString() + " / " + duelswins.toString() + "`\n" + - "**➺ KDR:** `" + - hsduelskd.toFixed(2).toString() + - "`\n" + "**➺ WLR:** `" + - hsduelswlr.toFixed(2).toString() + - "`" + hsduelswlr.toFixed(2).toString() + + " / " + duelswlr.toString() + "`\n" + + "**➺ KDR:** `" + + hsduelskd.toFixed(2).toString() + "`" } ] }]