Added duels wlr to stat check

This commit is contained in:
2023-08-06 11:21:52 +02:00
parent 01dc7f9673
commit d36ac507de
2 changed files with 19 additions and 24 deletions

View File

@@ -1,7 +1,5 @@
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require("discord.js");
require("discord.js"); const { bwfkdr, bwstars, bwwins, swstars, duelswins, duelswlr } = require("../config/reqs.json");
const { bwfdkr, bwstars, bwwins, duelswins, swstars } =
require("../config/reqs.json");
const env = require("dotenv").config(); const env = require("dotenv").config();
const hypixelApiKey = process.env.HYPIXELAPIKEY; const hypixelApiKey = process.env.HYPIXELAPIKEY;
const { color } = require("../config/options.json"); const { color } = require("../config/options.json");
@@ -127,7 +125,7 @@ module.exports = {
const hypixelExp = stats.data.player.networkExp; const hypixelExp = stats.data.player.networkExp;
const level = getExactLevel(hypixelExp); const level = getExactLevel(hypixelExp);
if (hsbwstars < bwstars || hsbwfkdr < bwfdkr || hsbwwins < bwwins) { if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) {
var bwtitle = var 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 { } else {
@@ -143,7 +141,7 @@ module.exports = {
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements."; "<a:check_a:1087808632172847134> This player meets the SkyWars requirements.";
} }
if (hsduelswins < duelswins) { if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
var duelstitle = var 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 { } else {
@@ -171,7 +169,7 @@ module.exports = {
bwstars.toString() + "`\n" + bwstars.toString() + "`\n" +
"**➺ FKDR:** `" + "**➺ FKDR:** `" +
hsbwfkdr.toFixed(2).toString() + hsbwfkdr.toFixed(2).toString() +
" / " + bwfdkr.toString() + "`\n" + " / " + bwfkdr.toString() + "`\n" +
"**➺ Wins:** `" + "**➺ Wins:** `" +
hsbwwins.toString() + " / " + hsbwwins.toString() + " / " +
bwwins.toString() + "`" bwwins.toString() + "`"
@@ -193,12 +191,11 @@ module.exports = {
value: "**➺ Wins:** `" + value: "**➺ Wins:** `" +
hsduelswins.toString() + hsduelswins.toString() +
" / " + duelswins.toString() + "`\n" + " / " + duelswins.toString() + "`\n" +
"**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() +
"`\n" +
"**➺ WLR:** `" + "**➺ WLR:** `" +
hsduelswlr.toFixed(2).toString() + hsduelswlr.toFixed(2).toString() +
"`" " / " + duelswlr.toString() + "`\n" +
"**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() + "`"
} }
] ]
}] }]

View File

@@ -1,7 +1,7 @@
const { color } = require('../../config/options.json'); const { color } = require('../../config/options.json');
const fetch = require('axios'); const fetch = require('axios');
const guildapp = require('../../schemas/guildAppSchema.js'); 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 env = require("dotenv").config();
const hypixelApiKey = process.env.HYPIXELAPIKEY; const hypixelApiKey = process.env.HYPIXELAPIKEY;
const { getExactLevel, skywarsLevel, getLevelForExp } = require("../../utils/functions.js"); const { getExactLevel, skywarsLevel, getLevelForExp } = require("../../utils/functions.js");
@@ -108,7 +108,7 @@ module.exports = {
const hypixelExp = stats.data.player.networkExp; const hypixelExp = stats.data.player.networkExp;
const level = getExactLevel(hypixelExp); const level = getExactLevel(hypixelExp);
if (hsbwstars < bwstars || hsbwfkdr < bwfdkr || hsbwwins < bwwins) { if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) {
var bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements." var bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
} else { } else {
var bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements." var bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements."
@@ -120,7 +120,7 @@ module.exports = {
var swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements." var swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
} }
if (hsduelswins < duelswins) { if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
var duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements." var duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
} else { } else {
var duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements." var duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements."
@@ -146,7 +146,7 @@ module.exports = {
bwstars.toString() + "`\n" + bwstars.toString() + "`\n" +
"**➺ FKDR:** `" + "**➺ FKDR:** `" +
hsbwfkdr.toFixed(2).toString() + hsbwfkdr.toFixed(2).toString() +
" / " + bwfdkr.toString() + "`\n" + " / " + bwfkdr.toString() + "`\n" +
"**➺ Wins:** `" + "**➺ Wins:** `" +
hsbwwins.toString() + " / " + hsbwwins.toString() + " / " +
bwwins.toString() + "`" bwwins.toString() + "`"
@@ -158,8 +158,7 @@ module.exports = {
hsswstars.toFixed(2).toString() + hsswstars.toFixed(2).toString() +
" / " + swstars.toString() + "`\n" + " / " + swstars.toString() + "`\n" +
"**➺ KDR:** `" + "**➺ KDR:** `" +
hsswkd.toFixed(2).toString() + hsswkd.toFixed(2).toString() + "`\n" +
"`\n" +
"**➺ Wins:** `" + "**➺ Wins:** `" +
hsswwins.toString() + "`" hsswwins.toString() + "`"
}, },
@@ -168,12 +167,11 @@ module.exports = {
value: "**➺ Wins:** `" + value: "**➺ Wins:** `" +
hsduelswins.toString() + hsduelswins.toString() +
" / " + duelswins.toString() + "`\n" + " / " + duelswins.toString() + "`\n" +
"**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() +
"`\n" +
"**➺ WLR:** `" + "**➺ WLR:** `" +
hsduelswlr.toFixed(2).toString() + hsduelswlr.toFixed(2).toString() +
"`" " / " + duelswlr.toString() + "`\n" +
"**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() + "`"
} }
] ]
}] }]