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;