From fb4fe700a6085409773bd758a299a7e2d4b340c9 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Tue, 30 Apr 2024 10:45:07 +0500 Subject: [PATCH] :shrug: --- commands/IAT/checkjar.js | 1 - helpers/birthdays.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/IAT/checkjar.js b/commands/IAT/checkjar.js index 22e14086..ca912386 100644 --- a/commands/IAT/checkjar.js +++ b/commands/IAT/checkjar.js @@ -55,7 +55,6 @@ class Checkjar extends BaseCommand { jarTransactions.length = 10; jarTransactions.forEach(t => { - // TODO const time = moment.unix(t.time); embed.data.fields.push([ diff --git a/helpers/birthdays.js b/helpers/birthdays.js index 61eba481..08e5e3c0 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -9,8 +9,8 @@ module.exports.init = async client => { client.guilds.cache.forEach(async guild => { const guildData = await client.findOrCreateGuild(guild.id); - if (guildData.plugins.birthdays) { - const channel = await guild.channels.fetch(guildData.plugins.birthdays), + if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) { + const channel = client.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), currentMonth = date.getMonth() + 1, @@ -67,8 +67,8 @@ module.exports.run = async client => { client.guilds.cache.forEach(async guild => { const guildData = await client.findOrCreateGuild(guild.id); - if (guildData.plugins.birthdays) { - const channel = await guild.channels.fetch(guildData.plugins.birthdays), + if (guildData.plugins.birthdays && client.channels.cache.get(guildData.plugins.birthdays)) { + const channel = client.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), currentMonth = date.getMonth() + 1,