From 2f13f95ea1ed6cc40b60d2f72847f322554cea36 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sat, 1 Apr 2023 14:40:44 -0700 Subject: [PATCH] debug combat log detection --- structures/DayzArmbands.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/structures/DayzArmbands.js b/structures/DayzArmbands.js index ba15879..68ce0f5 100644 --- a/structures/DayzArmbands.js +++ b/structures/DayzArmbands.js @@ -312,7 +312,7 @@ class DayzArmbands extends Client { if (data.lastDamageDate == null) return; let today = new Date(); - let newDt = new Date(`${today.toLocaleDateString('default', { month: 'long' })} ${today.getDate()}, ${today.getFullYear()} ${info.time} EST`); + let newDt = new Date(`${today.toLocaleDateString('default', { month: 'long' })} ${today.getDate()}, ${today.getFullYear()} ${data.time} EST`); let diffMs = (newDt - data.lastDamageDate) let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes @@ -322,14 +322,15 @@ class DayzArmbands extends Client { let guild = await this.GetGuild(guildId); if (!this.exists(guild.connectionLogsChannel)) return; const channel = this.channels.cache.get(guild.connectionLogsChannel); + if (!channel) return; let unixTime = Math.floor(newDt.getTime()/1000); let combatLog = new EmbedBuilder() .setColor(this.config.Colors.Red) - .setDescription(`**NOTICE:**\n**${info.player}** has combat logged at when fighting **${info.lastHitBy}**`); + .setDescription(`**NOTICE:**\n**${data.player}** has combat logged at when fighting **${data.lastHitBy}**`); - return channel.send({ embeds: {combatLog} }); + return channel.send({ embeds: [combatLog] }); } async handlePlayerLogs(guildId, stats, line) {