fix/compare combat rating

This commit is contained in:
SowinskiBraeden committed 2023-11-09 19:06:26 -08:00
1 parent 886fd6aff8
commit 7a0bf8ced4
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -43,15 +43,15 @@ module.exports = {
]).toArray(); ]).toArray();
let comp; let comp;
if (discord) comp = leaderboard.find(s => s.discordID = discord); if (discord) comp = leaderboard.find(s => s.discordID == discord);
if (gamertag) comp = leaderboard.find(s => s.gamertag == gamertag); if (gamertag) comp = leaderboard.find(s => s.gamertag == gamertag);
let self = leaderboard.find(s => s.discordID == interaction.member.user.id); let self = leaderboard.find(s => s.discordID == interaction.member.user.id);
if (!client.exists(comp)) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** Unable to find any records with the gamertag or user provided.`)] }); if (!client.exists(comp)) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** Unable to find any records with the gamertag or user provided.`)] });
if (!client.exists(self)) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** You haven't linked your gamertag and your stats cannot be found.`)] }); if (!client.exists(self)) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** You haven't linked your gamertag and your stats cannot be found.`)] });
let lbPosSelf = leaderboard.indexOf(self); let lbPosSelf = leaderboard.indexOf(self) + 1;
let lbPosComp = leaderboard.indexOf(comp); let lbPosComp = leaderboard.indexOf(comp) + 1;
let selfData = self.combatRatingHistory; let selfData = self.combatRatingHistory;
let compData = comp.combatRatingHistory; let compData = comp.combatRatingHistory;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayzr-bot", "name": "dayzr-bot",
"version": "12.4.3", "version": "12.4.4",
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {