mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 06:34:58 +05:00
hope 🙏
This commit is contained in:
parent
fb4fe700a6
commit
913bdb7814
1 changed files with 9 additions and 5 deletions
|
@ -8,10 +8,10 @@ module.exports.init = async client => {
|
||||||
const cronjob = new CronJob("0 5 * * *", async function () {
|
const cronjob = new CronJob("0 5 * * *", async function () {
|
||||||
client.guilds.cache.forEach(async guild => {
|
client.guilds.cache.forEach(async guild => {
|
||||||
const guildData = await client.findOrCreateGuild(guild.id);
|
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)) {
|
if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) {
|
||||||
const channel = client.channels.cache.get(guildData.plugins.birthdays),
|
const date = new Date(),
|
||||||
date = new Date(),
|
|
||||||
currentDay = date.getDate(),
|
currentDay = date.getDate(),
|
||||||
currentMonth = date.getMonth() + 1,
|
currentMonth = date.getMonth() + 1,
|
||||||
currentYear = date.getFullYear();
|
currentYear = date.getFullYear();
|
||||||
|
@ -63,13 +63,17 @@ module.exports.init = async client => {
|
||||||
cronjob.start();
|
cronjob.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {import("../base/Client")} client
|
||||||
|
*/
|
||||||
module.exports.run = async client => {
|
module.exports.run = async client => {
|
||||||
client.guilds.cache.forEach(async guild => {
|
client.guilds.cache.forEach(async guild => {
|
||||||
const guildData = await client.findOrCreateGuild(guild.id);
|
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)) {
|
if (guildData.plugins.birthdays) {
|
||||||
const channel = client.channels.cache.get(guildData.plugins.birthdays),
|
const date = new Date(),
|
||||||
date = new Date(),
|
|
||||||
currentDay = date.getDate(),
|
currentDay = date.getDate(),
|
||||||
currentMonth = date.getMonth() + 1,
|
currentMonth = date.getMonth() + 1,
|
||||||
currentYear = date.getFullYear();
|
currentYear = date.getFullYear();
|
||||||
|
|
Loading…
Reference in a new issue