This commit is contained in:
Jonny_Bro (Nikita) 2024-06-17 17:00:03 +05:00
parent 0baaa76be3
commit fb8b1d8496
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8

View file

@ -8,7 +8,11 @@ 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.getGuildData(guild.id); const guildData = await client.getGuildData(guild.id);
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null; let channel;
try {
channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
} catch (e) { /* Nothing */ }
if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) { if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) {
const date = new Date(), const date = new Date(),
@ -70,7 +74,11 @@ module.exports.init = async 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.getGuildData(guild.id); const guildData = await client.getGuildData(guild.id);
const channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null; let channel;
try {
channel = guildData.plugins.birthdays ? client.channels.cache.get(guildData.plugins.birthdays) || (await client.channels.fetch(guildData.plugins.birthdays)) : null;
} catch (e) { /* Nothing */ }
if (guildData.plugins.birthdays) { if (guildData.plugins.birthdays) {
const date = new Date(), const date = new Date(),