fix birthdays announcements (i hope)

This commit is contained in:
Jonny_Bro (Nikita) 2024-04-10 17:45:25 +05:00
parent 321189f285
commit dcdaf66b76
Signed by: jonny_bro
GPG key ID: 3F1ECC04147E9BD8
2 changed files with 6 additions and 6 deletions

View file

@ -13,7 +13,7 @@ module.exports.init = async client => {
const channel = guild.channels.cache.get(guildData.plugins.birthdays), const channel = guild.channels.cache.get(guildData.plugins.birthdays),
date = new Date(), date = new Date(),
currentDay = date.getDate(), currentDay = date.getDate(),
currentMonth = date.getMonth(), currentMonth = date.getMonth() + 1,
currentYear = date.getFullYear(); currentYear = date.getFullYear();
if (channel) { if (channel) {
@ -23,7 +23,7 @@ module.exports.init = async client => {
const userDate = new Date(user.birthdate * 1000), const userDate = new Date(user.birthdate * 1000),
day = userDate.getDate(), day = userDate.getDate(),
month = userDate.getMonth(), month = userDate.getMonth() + 1,
year = userDate.getFullYear(), year = userDate.getFullYear(),
age = currentYear - year; age = currentYear - year;
@ -71,7 +71,7 @@ module.exports.run = async client => {
const channel = guild.channels.cache.get(guildData.plugins.birthdays), const channel = guild.channels.cache.get(guildData.plugins.birthdays),
date = new Date(), date = new Date(),
currentDay = date.getDate(), currentDay = date.getDate(),
currentMonth = date.getMonth(), currentMonth = date.getMonth() + 1,
currentYear = date.getFullYear(); currentYear = date.getFullYear();
if (channel) { if (channel) {
@ -79,9 +79,9 @@ module.exports.run = async client => {
for (const user of users) { for (const user of users) {
if (!guild.members.cache.find(m => m.id === user.id)) return; 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(), day = userDate.getDate(),
month = userDate.getMonth(), month = userDate.getMonth() + 1,
year = userDate.getFullYear(), year = userDate.getFullYear(),
age = currentYear - year; age = currentYear - year;

View file

@ -4,7 +4,7 @@
"EXAMPLES": "config list\nconfig set setting:reports state:True channel:#reports", "EXAMPLES": "config list\nconfig set setting:reports state:True channel:#reports",
"SPECIAL_CHANNELS": "Special Channels", "SPECIAL_CHANNELS": "Special Channels",
"BIRTHDAYS": "Birthday Greetings", "BIRTHDAYS": "Birthdays Announcements",
"MODLOGS": "Moderation Logs", "MODLOGS": "Moderation Logs",
"REPORTS": "Reports", "REPORTS": "Reports",
"SUGGESTIONS": "Suggestions", "SUGGESTIONS": "Suggestions",