EZD Logik

This commit is contained in:
2026-07-02 18:37:22 +02:00
parent 8d7e47af3f
commit 6b2fab8b95
5 changed files with 374 additions and 63 deletions
+13 -8
View File
@@ -50,8 +50,19 @@ module.exports = {
if (!dbEntry) continue;
// skip if already notified
if (dbEntry.notified) {
// Reset notification once the birthday has passed
if (!isToday(dbEntry.day, dbEntry.month) && dbEntry.notified) {
await bdayColl.updateOne(
{ userID: member.id },
{ $set: { notified: false } }
);
dbEntry.notified = false; // keep local copy in sync
console.log(`Removed notified flag for ${member.user.tag}`);
}
// Skip if already handled today
if (dbEntry.notified && isToday(dbEntry.day, dbEntry.month)) {
console.log(`${member.user.username} was already notified today, skipping...`);
continue;
}
@@ -78,12 +89,6 @@ module.exports = {
console.log(`Removed birthday role from ${member.user.tag}`);
}
// reset notification flag if not birthday anymore
await bdayColl.updateOne(
{ userID: member.id },
{ $set: { notified: false } }
);
}
}
};