Debug things make alarm work??

This commit is contained in:
SowinskiBraeden committed 2023-04-08 16:45:42 -07:00
1 parent b723341578
commit 05a4022f96
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayz-armbands", "name": "dayz-armbands",
"version": "6.3.3", "version": "6.3.4",
"description": "A General Purpose Discord Bot for DayZ Servers.", "description": "A General Purpose Discord Bot for DayZ Servers.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {
+4 -3
View File
@@ -13,6 +13,7 @@ const { HandleKillfeed } = require('../util/KillfeedHandler');
const path = require("path"); const path = require("path");
const fs = require('fs'); const fs = require('fs');
const readline = require('readline'); const readline = require('readline');
const { HandleAlarms } = require("../util/AlarmsHandler");
const minute = 60000; // 1 minute in milliseconds const minute = 60000; // 1 minute in milliseconds
@@ -133,11 +134,11 @@ class DayzArmbands extends Client {
let s = guild.playerstats; let s = guild.playerstats;
for (let i = logIndex + 1; i < lines.length; i++) { for (let i = logIndex + 1; i < lines.length; i++) {
let c = s.find(p => p.connected == true); for (let j = 0; j < s.length; j++) {
for (let j = 0; j < c.length; j++) { if (!s[j].connected) continue;
let inLog = false; let inLog = false;
let connected = true; let connected = true;
if (lines[i].includes(c[j].gamertag)) { if (lines[i].includes(s[j].gamertag)) {
inLog = true; inLog = true;
connected = lines[i].includes(' connected') ? true : lines[i].includes('disconnected') ? false : connected; connected = lines[i].includes(' connected') ? true : lines[i].includes('disconnected') ? false : connected;
} }
+1 -2
View File
@@ -4,7 +4,7 @@ const { EmbedBuilder } = require('discord.js');
module.exports = { module.exports = {
HandleAlarms: async (client, guildId, data) => { HandleAlarms: async (client, guildId, data) => {
let guild = await client.GetGuild(guildId); let guild = await client.GetGuild(guildId);
for (let i = 0; i < guild.alarms.length; i++) { for (let i = 0; i < guild.alarms.length; i++) {
@@ -39,7 +39,6 @@ module.exports = {
.addFields({ name: '**Location**', value: `**[${data.pos[0]}, ${data.pos[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${data.pos[0]};${data.pos[1]})**`, inline: false }) .addFields({ name: '**Location**', value: `**[${data.pos[0]}, ${data.pos[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${data.pos[0]};${data.pos[1]})**`, inline: false })
return await channel.send({ content: `<@&${alarm.role}>`, embeds: [alarmEmbed] }); return await channel.send({ content: `<@&${alarm.role}>`, embeds: [alarmEmbed] });
// }
} }
} }
}, },