From c8f555b6d1ae48b71d41a9ad540a964cb4c5a8bd Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Thu, 9 Nov 2023 10:27:53 -0800 Subject: [PATCH] fix/handle new weapons in weaponStats --- commands/weapon-stats.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/weapon-stats.js b/commands/weapon-stats.js index 1877c01..96b387d 100644 --- a/commands/weapon-stats.js +++ b/commands/weapon-stats.js @@ -1,7 +1,7 @@ const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js'); const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes; const { weapons } = require('../database/weapons'); -const { insertPVPstats } = require('../database/player'); +const { insertPVPstats, createWeaponStats } = require('../database/player'); module.exports = { name: "weapon-stats", @@ -102,6 +102,7 @@ module.exports = { const tag = player.discordID != "" ? `<@${player.discordID}>'s` : `**${player.gamertag}'s**`; if (!client.exists(player.shotsLanded)) player = insertPVPstats(player); + if (!client.exists(player.weaponStats[weapon])) player = createWeaponStats(player, weapon); let stats = new EmbedBuilder() .setColor(client.config.Colors.Default)