update/queue alarm ping

This commit is contained in:
SowinskiBraeden committed 2023-09-24 17:59:53 -07:00
1 parent b5dca5ad07
commit 961522930f
3 files changed
+28 -15

No files matched your search

+9
View File
@@ -41,6 +41,7 @@ class DayzRBot extends Client {
this.arInterval = arInterval;
this.arIntervalId; // Interval for auto-restart functions
this.playerSessions = new Map();
this.alarmPingQueue = {};
this.autoRestartInit();
this.LoadCommandsAndInteractionHandlers();
this.LoadEvents();
@@ -155,6 +156,14 @@ class DayzRBot extends Client {
if (lines[i].includes('killed by Player') && !lines[i - 1].includes('hit by Player')) s = await HandleKillfeed(this, guildId, s, lines[i]); // Handles deaths missing hit by log
}
for (const [channel_id, role] of Object.entries(client.alarmPingQueue)) {
const channel = client.GetChannel(channel_id);
channel.send({ content: `<@&${role}>`, embeds: client.alarmPingQueue[channel_id][role] });
}
client.alarmPingQueue = {};
const playerTemplate = /(.*) \| Player \"(.*)\" \(id=(.*) pos=<(.*)>\)/g;
let previouslyConnected = s.filter(p => p.connected); // All players with connection log captured above and no disconnect log
let lastDetectedTime;