fix/handle new weapons in weaponStats
This commit is contained in:
1 file changed
+2
-1
@@ -1,7 +1,7 @@
|
|||||||
const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js');
|
const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js');
|
||||||
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
|
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
|
||||||
const { weapons } = require('../database/weapons');
|
const { weapons } = require('../database/weapons');
|
||||||
const { insertPVPstats } = require('../database/player');
|
const { insertPVPstats, createWeaponStats } = require('../database/player');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "weapon-stats",
|
name: "weapon-stats",
|
||||||
@@ -102,6 +102,7 @@ module.exports = {
|
|||||||
const tag = player.discordID != "" ? `<@${player.discordID}>'s` : `**${player.gamertag}'s**`;
|
const tag = player.discordID != "" ? `<@${player.discordID}>'s` : `**${player.gamertag}'s**`;
|
||||||
|
|
||||||
if (!client.exists(player.shotsLanded)) player = insertPVPstats(player);
|
if (!client.exists(player.shotsLanded)) player = insertPVPstats(player);
|
||||||
|
if (!client.exists(player.weaponStats[weapon])) player = createWeaponStats(player, weapon);
|
||||||
|
|
||||||
let stats = new EmbedBuilder()
|
let stats = new EmbedBuilder()
|
||||||
.setColor(client.config.Colors.Default)
|
.setColor(client.config.Colors.Default)
|
||||||
|
|||||||
Reference in new issue
Block a user