From dcdaf66b7663ed6c5b651a788161107d1c8dc0c0 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Wed, 10 Apr 2024 17:45:25 +0500 Subject: [PATCH] fix birthdays announcements (i hope) --- helpers/birthdays.js | 10 +++++----- languages/en-US/administration/config.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helpers/birthdays.js b/helpers/birthdays.js index 9a00210c..41e8f7d5 100644 --- a/helpers/birthdays.js +++ b/helpers/birthdays.js @@ -13,7 +13,7 @@ module.exports.init = async client => { const channel = guild.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), - currentMonth = date.getMonth(), + currentMonth = date.getMonth() + 1, currentYear = date.getFullYear(); if (channel) { @@ -23,7 +23,7 @@ module.exports.init = async client => { const userDate = new Date(user.birthdate * 1000), day = userDate.getDate(), - month = userDate.getMonth(), + month = userDate.getMonth() + 1, year = userDate.getFullYear(), age = currentYear - year; @@ -71,7 +71,7 @@ module.exports.run = async client => { const channel = guild.channels.cache.get(guildData.plugins.birthdays), date = new Date(), currentDay = date.getDate(), - currentMonth = date.getMonth(), + currentMonth = date.getMonth() + 1, currentYear = date.getFullYear(); if (channel) { @@ -79,9 +79,9 @@ module.exports.run = async client => { for (const user of users) { if (!guild.members.cache.find(m => m.id === user.id)) return; - const userDate = new Date(user.birthdate), + const userDate = new Date(user.birthdate * 1000), day = userDate.getDate(), - month = userDate.getMonth(), + month = userDate.getMonth() + 1, year = userDate.getFullYear(), age = currentYear - year; diff --git a/languages/en-US/administration/config.json b/languages/en-US/administration/config.json index 4fe18045..22419906 100644 --- a/languages/en-US/administration/config.json +++ b/languages/en-US/administration/config.json @@ -4,7 +4,7 @@ "EXAMPLES": "config list\nconfig set setting:reports state:True channel:#reports", "SPECIAL_CHANNELS": "Special Channels", - "BIRTHDAYS": "Birthday Greetings", + "BIRTHDAYS": "Birthdays Announcements", "MODLOGS": "Moderation Logs", "REPORTS": "Reports", "SUGGESTIONS": "Suggestions",