From fe7dc7d2f45abfd188fc0ba2f4fe47499b9b3c71 Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Tue, 23 Apr 2024 09:39:12 -0700 Subject: [PATCH] fix/handle no coordinates in location cmd --- commands/location.js | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/location.js b/commands/location.js index fb3bd01..d6e2902 100644 --- a/commands/location.js +++ b/commands/location.js @@ -32,6 +32,12 @@ module.exports = { let playerStat = await client.dbo.collection("players").findOne({"discordID": interaction.member.user.id}); if (!client.exists(playerStat)) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** You haven't linked your gamertag and are unable to use this command.`)], flags: (1 << 6) }); + if (!client.exists(playerStat.time)) return interaction.send({ emeds: [ + new EmbedBuilder() + .setColor(client.config.Colors.Yellow) + .setDescription(`**Not Found** There is no location saved to your gamertag yet. Make sure you've logged into the server for more than **5 minutes.**`) + ] }); + let newDt = await client.getDateEST(playerStat.time); let unixTime = Math.floor(newDt.getTime()/1000); diff --git a/package.json b/package.json index ebc7f61..2acba16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "13.0.6", + "version": "13.0.7", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": {