chore: 🎉 initial commit

This commit is contained in:
UltraLionFr
2025-08-26 01:01:34 +02:00
parent bf6d61e5a3
commit 30cfbd73fc
27 changed files with 1341 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
const activeAlerts = new Map();
function scheduleTicketClosure(channel, duration, closeFn) {
if (activeAlerts.has(channel.id)) {
clearTimeout(activeAlerts.get(channel.id));
}
const timeout = setTimeout(async () => {
activeAlerts.delete(channel.id);
await closeFn();
}, duration);
activeAlerts.set(channel.id, timeout);
}
function cancelTicketClosure(channelId) {
if (activeAlerts.has(channelId)) {
clearTimeout(activeAlerts.get(channelId));
activeAlerts.delete(channelId);
return true;
}
return false;
}
module.exports = { scheduleTicketClosure, cancelTicketClosure };