hope 🙏

This commit is contained in:
Jonny_Bro (Nikita) 2024-04-30 10:50:52 +05:00
parent fb4fe700a6
commit 913bdb7814
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -8,10 +8,10 @@ module.exports.init = async client => {
const cronjob = new CronJob("0 5 * * *", async function () {
client.guilds.cache.forEach(async guild => {
const guildData = await client.findOrCreateGuild(guild.id);
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) {
const channel = client.channels.cache.get(guildData.plugins.birthdays),
date = new Date(),
const date = new Date(),
currentDay = date.getDate(),
currentMonth = date.getMonth() + 1,
currentYear = date.getFullYear();
@ -63,13 +63,17 @@ module.exports.init = async client => {
cronjob.start();
};
/**
*
* @param {import("../base/Client")} client
*/
module.exports.run = async client => {
client.guilds.cache.forEach(async guild => {
const guildData = await client.findOrCreateGuild(guild.id);
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) {
const channel = client.channels.cache.get(guildData.plugins.birthdays),
date = new Date(),
if (guildData.plugins.birthdays) {
const date = new Date(),
currentDay = date.getDate(),
currentMonth = date.getMonth() + 1,
currentYear = date.getFullYear();