Added Notifications, Auto-Reassign on Timer Expiration, Add Randomizer

This commit is contained in:
2026-06-09 21:08:52 +02:00
parent 11102fc3a5
commit 346cf6d863
7 changed files with 440 additions and 27 deletions
+27
View File
@@ -0,0 +1,27 @@
async function getMember(client, userId) {
const guild = client.guilds.cache.get(process.env.D_GuildID);
if (!guild) return null;
// cache first (fast path)
let member = guild.members.cache.get(userId);
// fallback (safe path)
if (!member) {
member = await guild.members.fetch(userId).catch(() => null);
}
return member;
}
module.exports = {
name: 'timer24h',
async execute(timer, client) {
const member = await getMember(client, timer.assignedUser);
if (!member) return;
await member.send(
`⚠️ Less than 24 hours remaining for: **${timer.topic}**`
).catch(() => {});
}
};