From 51164d879d4af9e79ea80956c19bb395d65921f2 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Tue, 28 Mar 2023 19:12:43 -0700 Subject: [PATCH] fix --- commands/gamertag-link.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/gamertag-link.js b/commands/gamertag-link.js index 6b4f61c..abb530d 100644 --- a/commands/gamertag-link.js +++ b/commands/gamertag-link.js @@ -28,7 +28,7 @@ module.exports = { run: async (client, interaction, args, { GuildDB }) => { if (!client.exists(GuildDB.playerstats)) { - GuildDB.playerstats = []; + GuildDB.playerstats = [{}]; this.dbo.collection("guilds").updateOne({ "server.serverID": guild.serverID }, { $set: { "server.playerstats": [] @@ -38,7 +38,7 @@ module.exports = { }); } - let playerStat = GuildDB.playerstats.find(stat => stat.player == args[0].value[0]); + let playerStat = GuildDB.playerstats.find(stat => stat.player == args[0].value[0] ); if (playerStat == undefined) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription('**Not Found** This player cannot be found, the gamertag may be incorrect or this player has not logged onto the server before for at least ` 5 minutes `.')] }); playerStat.discordID = interaction.member.user.id;