security hardening
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const { CONFIG, parseThresholdString } = require('../config');
|
||||
const { shouldFireCooldownEscalating, clearEscalating } = require('./patternStore');
|
||||
const { enqueueSend } = require('./channelQueue');
|
||||
|
||||
// channelId → { lastStaffMessageAt, unrespondedCount, lastAlertAt }
|
||||
const chatState = new Map();
|
||||
@@ -64,7 +65,7 @@ async function runChatAlertChecks(client) {
|
||||
try {
|
||||
const alertChan = await client.channels.fetch(alertChannelId);
|
||||
const content = CONFIG.SURGE_ROLE_ID ? `<@&${CONFIG.SURGE_ROLE_ID}>` : undefined;
|
||||
if (alertChan) await alertChan.send({ content, embeds: [embed] });
|
||||
if (alertChan) await enqueueSend(alertChan, { content, embeds: [embed] });
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +83,7 @@ async function runChatAlertChecks(client) {
|
||||
try {
|
||||
const alertChan = await client.channels.fetch(alertChannelId);
|
||||
const content = CONFIG.SURGE_ROLE_ID ? `<@&${CONFIG.SURGE_ROLE_ID}>` : undefined;
|
||||
if (alertChan) await alertChan.send({ content, embeds: [embed] });
|
||||
if (alertChan) await enqueueSend(alertChan, { content, embeds: [embed] });
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user