trying birthdays again

This commit is contained in:
Jonny_Bro (Nikita) 2024-07-09 21:56:10 +05:00
parent 6ad65e7019
commit 4728258071
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -7,6 +7,9 @@ const { CronJob } = require("cron");
module.exports.init = async client => {
const cronjob = new CronJob("0 5 * * *", async function () {
client.guilds.cache.forEach(async guild => {
try {
console.log(`Checking birthdays for "${guild.name}"`);
const guildData = await client.getGuildData(guild.id);
const channel = guildData.plugins.birthdays ? await client.channels.fetch(guildData.plugins.birthdays) : null;
@ -52,6 +55,10 @@ module.exports.init = async client => {
}
});
}
} catch (err) {
if (err.code === 10003) console.log("Unknown channel");
else throw err;
}
});
},
null,