diff --git a/assets/324e0343bfdf5a9952cf6aee4a2d2b90.gif b/assets/324e0343bfdf5a9952cf6aee4a2d2b90.gif new file mode 100644 index 0000000..531dc43 Binary files /dev/null and b/assets/324e0343bfdf5a9952cf6aee4a2d2b90.gif differ diff --git a/assets/doggo.jpg b/assets/doggo.jpg new file mode 100644 index 0000000..2872983 Binary files /dev/null and b/assets/doggo.jpg differ diff --git a/assets/mittwoch/donnerstag.jpg b/assets/mittwoch/donnerstag.jpg new file mode 100644 index 0000000..0086dd7 Binary files /dev/null and b/assets/mittwoch/donnerstag.jpg differ diff --git a/assets/mittwoch/freitag.jpg b/assets/mittwoch/freitag.jpg new file mode 100644 index 0000000..0b292a9 Binary files /dev/null and b/assets/mittwoch/freitag.jpg differ diff --git a/assets/mittwoch/mittwoch.jpg b/assets/mittwoch/mittwoch.jpg new file mode 100644 index 0000000..84ecdab Binary files /dev/null and b/assets/mittwoch/mittwoch.jpg differ diff --git a/assets/mittwoch/montag.jpg b/assets/mittwoch/montag.jpg new file mode 100644 index 0000000..ad1fc98 Binary files /dev/null and b/assets/mittwoch/montag.jpg differ diff --git a/assets/mittwoch/nicht_mittwoch.jpg b/assets/mittwoch/nicht_mittwoch.jpg new file mode 100644 index 0000000..deaaec7 Binary files /dev/null and b/assets/mittwoch/nicht_mittwoch.jpg differ diff --git a/legacyCommands/nuts/nutsCheck.js b/commands/legacy/nuts/nutsCheck.js similarity index 94% rename from legacyCommands/nuts/nutsCheck.js rename to commands/legacy/nuts/nutsCheck.js index 4f81afc..b803f14 100644 --- a/legacyCommands/nuts/nutsCheck.js +++ b/commands/legacy/nuts/nutsCheck.js @@ -1,5 +1,5 @@ const { EmbedBuilder } = require('discord.js') -const { mClient } = require('../../index') +const { mClient } = require('../../../index') function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } require('dotenv').config() module.exports = { diff --git a/legacyCommands/nuts/nutsCooldown.js b/commands/legacy/nuts/nutsCooldown.js similarity index 91% rename from legacyCommands/nuts/nutsCooldown.js rename to commands/legacy/nuts/nutsCooldown.js index b2c818b..7d1c0ab 100644 --- a/legacyCommands/nuts/nutsCooldown.js +++ b/commands/legacy/nuts/nutsCooldown.js @@ -1,5 +1,5 @@ const { EmbedBuilder } = require('discord.js') -const { mClient } = require('../../index') +const { mClient } = require('../../../index') require('dotenv').config() module.exports = { name: 'nutsCooldown', @@ -13,7 +13,7 @@ module.exports = { let content = `Du kannst wieder nussen! :)` let thumbnail = 'https://cdn-icons-png.flaticon.com/512/7451/7451659.png' let title = 'Go Nuts!' - if (cooldown) { + if (cooldown > 0) { content = ` kannst du wieder nussen! ;)` thumbnail = 'https://cdn.discordapp.com/attachments/1152723542836772914/1152987472788193361/No-nuts-PhotoRoom.png-PhotoRoom.png' title = 'To Nut or Not to Nut...' diff --git a/legacyCommands/nuts/nutsGet.js b/commands/legacy/nuts/nutsGet.js similarity index 92% rename from legacyCommands/nuts/nutsGet.js rename to commands/legacy/nuts/nutsGet.js index 0de7966..0843263 100644 --- a/legacyCommands/nuts/nutsGet.js +++ b/commands/legacy/nuts/nutsGet.js @@ -1,4 +1,4 @@ -const { mClient } = require('../../index') +const { mClient } = require('../../../index') require('dotenv').config() module.exports = { name: 'nuts', diff --git a/legacyCommands/nuts/nutsGive.js b/commands/legacy/nuts/nutsGive.js similarity index 95% rename from legacyCommands/nuts/nutsGive.js rename to commands/legacy/nuts/nutsGive.js index aef3d50..8f64e4d 100644 --- a/legacyCommands/nuts/nutsGive.js +++ b/commands/legacy/nuts/nutsGive.js @@ -1,5 +1,5 @@ const { EmbedBuilder, MessageFlags } = require('discord.js') -const { mClient } = require('../../index') +const { mClient } = require('../../../index') function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } require('dotenv').config() module.exports = { diff --git a/legacyCommands/nuts/nutsLeaderboard.js b/commands/legacy/nuts/nutsLeaderboard.js similarity index 89% rename from legacyCommands/nuts/nutsLeaderboard.js rename to commands/legacy/nuts/nutsLeaderboard.js index 8630f15..e22d91a 100644 --- a/legacyCommands/nuts/nutsLeaderboard.js +++ b/commands/legacy/nuts/nutsLeaderboard.js @@ -1,5 +1,5 @@ const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js') -const { mClient } = require('../../index') +const { mClient } = require('../../../index') function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } require('dotenv').config() module.exports = { @@ -37,7 +37,7 @@ module.exports = { }) const embed = new EmbedBuilder() .setTitle('Nuts Leaderboard') - .setThumbnail('https://cdn.discordapp.com/attachments/1152723542836772914/1152940755539722240/pngwing.com.png') + .setThumbnail(message.guild.iconURL({ dynamic: true})) .setDescription(fields.toString()) .setColor('#5865F2') // Discord's blurple color .setFooter({ text: 'Use ◄ ► to navigate' }); diff --git a/legacyCommands/nuts/nutsStats.js b/commands/legacy/nuts/nutsStats.js similarity index 95% rename from legacyCommands/nuts/nutsStats.js rename to commands/legacy/nuts/nutsStats.js index 9216bbd..7b54320 100644 --- a/legacyCommands/nuts/nutsStats.js +++ b/commands/legacy/nuts/nutsStats.js @@ -1,5 +1,5 @@ const { EmbedBuilder } = require('discord.js') -const { mClient } = require('../../index') +const { mClient } = require('../../../index') function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } require('dotenv').config() module.exports = { diff --git a/commands/social/birthday.js b/commands/slash/admin/birthdays.js similarity index 85% rename from commands/social/birthday.js rename to commands/slash/admin/birthdays.js index 1ea7e90..307a04a 100644 --- a/commands/social/birthday.js +++ b/commands/slash/admin/birthdays.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js') -const { mClient } = require('../..') +const { mClient } = require('../../../index') const { configDotenv } = require('dotenv') configDotenv() @@ -32,7 +32,6 @@ function isValidDate(day, month) { return true; } - async function birthdayAdd(interaction) { let target = await interaction.options.getUser('user') let day = await interaction.options.getNumber('day') @@ -119,12 +118,6 @@ async function birthdayEdit(interaction) { const res = await bdayColl.findOneAndUpdate({ userID: target.id }, { $set: data }, { upsert: true }) return interaction.reply({ content: "Birthday edited successfully!" }) } -async function isDateInPast(day, month) { - const currentYear = new Date().getFullYear(); - const inputDate = new Date(currentYear, month - 1, day); - const now = new Date(); - return inputDate < now; -} async function makeTimestamp(day, month, year) { const date = new Date(year, month - 1, day); const unixTimestamp = Math.floor(date.getTime() / 1000); @@ -141,31 +134,53 @@ function isToday(day, month) { ); } async function birthdayGet(interaction) { - let target = await interaction.options.getUser('user') - const db = mClient.db(process.env.M_DB) - const bdayColl = db.collection('items_birthdays') + const target = await interaction.options.getUser('user'); + const db = mClient.db(process.env.M_DB); + const bdayColl = db.collection('items_birthdays'); - const found = await bdayColl.findOne({ userID: target.id }) + const found = await bdayColl.findOne({ userID: target.id }); if (!found) { - return interaction.reply({ content: "Not in Database!", flags: MessageFlags.Ephemeral }) + return interaction.reply({ + content: "Not in Database!", + flags: MessageFlags.Ephemeral + }); } - let unix - if(isDateInPast(found.day,found.month)){ - let nextYear = new Date().getFullYear() + 1 - unix = await makeTimestamp(found.day,found.month, nextYear) + + const now = new Date(); + const isToday = + now.getDate() === found.day && + now.getMonth() === (found.month - 1); + + let description; + + if (isToday) { + description = `IS TODAY! 🥳🎉`; } else { - let thisYear = new Date().getFullYear() - unix = await makeTimestamp(found.day,found.month, thisYear) - } - let description = `is on the \r\n` - if(isToday(found.day, found.month)){ - description = `IS TODAY!🥳🎉` + const unix = getNextBirthdayTimestamp(found.day, found.month); + description = `is on the \n`; } + const embed = new EmbedBuilder() .setThumbnail(target.displayAvatarURL()) - .setTitle(`${target.globalName ? target.globalName: target.username}'s Birthday!`) - .setDescription(description) - await interaction.reply({ embeds: [embed] }) + .setTitle(`${target.globalName ?? target.username}'s Birthday...`) + .setDescription(description); + + await interaction.reply({ embeds: [embed] }); +} +function getNextBirthdayTimestamp(day, month) { + const now = new Date(); + now.setHours(0, 0, 0, 0); + + const currentYear = now.getFullYear(); + + let nextBirthday = new Date(currentYear, month - 1, day); + + // If birthday already passed this year → next year + if (nextBirthday < now) { + nextBirthday.setFullYear(currentYear + 1); + } + + return Math.floor(nextBirthday.getTime() / 1000); // Unix timestamp } module.exports = { diff --git a/commands/config/config.js b/commands/slash/admin/config.js similarity index 99% rename from commands/config/config.js rename to commands/slash/admin/config.js index 90ffac0..23dc6a0 100644 --- a/commands/config/config.js +++ b/commands/slash/admin/config.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js') -const { mClient } = require('../..') +const { mClient } = require('../../../index') require('dotenv').config() async function channelSet(interaction) { diff --git a/commands/honors/honors.js b/commands/slash/applications/honors.js similarity index 97% rename from commands/honors/honors.js rename to commands/slash/applications/honors.js index 3573da9..13651cd 100644 --- a/commands/honors/honors.js +++ b/commands/slash/applications/honors.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') -const { mClient } = require('../..') +const { mClient } = require('../../../index') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } diff --git a/commands/nuts/nuts.js b/commands/slash/applications/nuts.js similarity index 96% rename from commands/nuts/nuts.js rename to commands/slash/applications/nuts.js index f405f7d..13dbe84 100644 --- a/commands/nuts/nuts.js +++ b/commands/slash/applications/nuts.js @@ -1,5 +1,5 @@ const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require('discord.js') -const { mClient } = require('../..') +const { mClient } = require('../../../index') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function nutsGive(interaction) { @@ -128,7 +128,7 @@ async function nutsLeaderboard(interaction) { }) const embed = new EmbedBuilder() .setTitle('Nuts Leaderboard') - .setThumbnail('https://cdn.discordapp.com/attachments/1152723542836772914/1152940755539722240/pngwing.com.png') + .setThumbnail(interaction.guild.iconURL({ dynamic: true })) .setDescription(fields.toString()) .setColor('#5865F2') // Discord's blurple color .setFooter({ text: 'Use ◄ ► to navigate' }); diff --git a/commands/quotes/quotes.js b/commands/slash/applications/quotes.js similarity index 96% rename from commands/quotes/quotes.js rename to commands/slash/applications/quotes.js index 26ff88c..ec9dc5c 100644 --- a/commands/quotes/quotes.js +++ b/commands/slash/applications/quotes.js @@ -3,7 +3,7 @@ Random By Year? Counter (Leaderboard) */ const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') -const { mClient } = require('../..') +const { mClient } = require('../../../index') require('dotenv').config() function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } diff --git a/commands/slash/memes/8ball.js b/commands/slash/memes/8ball.js new file mode 100644 index 0000000..e69de29 diff --git a/commands/slash/memes/avatar.js b/commands/slash/memes/avatar.js new file mode 100644 index 0000000..e69de29 diff --git a/commands/slash/memes/doggo.js b/commands/slash/memes/doggo.js new file mode 100644 index 0000000..e69de29 diff --git a/commands/slash/memes/emoji.js b/commands/slash/memes/emoji.js new file mode 100644 index 0000000..e69de29 diff --git a/commands/slash/memes/interact.js b/commands/slash/memes/interact.js new file mode 100644 index 0000000..e69de29 diff --git a/commands/slash/memes/mittwoch.js b/commands/slash/memes/mittwoch.js new file mode 100644 index 0000000..e69de29 diff --git a/handlers/commands_legacy.js b/handlers/commands_legacy.js new file mode 100644 index 0000000..cbe9ac1 --- /dev/null +++ b/handlers/commands_legacy.js @@ -0,0 +1,28 @@ +const fs = require('node:fs') +const path = require('node:path') +module.exports = (client) => { + const legacyFoldersPath = path.join(__dirname, '../commands/legacy'); + const legacyCommandFolders = fs.readdirSync(legacyFoldersPath); + let legacyCount = 0 + let aliasCount = 0 + for (const folder of legacyCommandFolders) { + const commandsPath = path.join(legacyFoldersPath, folder); + const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); + for (const file of commandFiles) { + legacyCount++ + const filePath = path.join(commandsPath, file); + const command = require(filePath); + if ('execute' in command) { + client.legacyCommands.set(command.name, command); + } + if (command.aliases && Array.isArray(command.aliases)) { + command.aliases.forEach(alias => { + aliasCount++ + client.aliases.set(alias, command.name) + }) + } + } + } + console.log(`[${aliasCount}] Aliase(s) initialized`) + console.log(`[${legacyCount}] Legacy Command(s) initialized`) +} diff --git a/handlers/commands.js b/handlers/commands_slash.js similarity index 94% rename from handlers/commands.js rename to handlers/commands_slash.js index 7495ba7..9073082 100644 --- a/handlers/commands.js +++ b/handlers/commands_slash.js @@ -5,7 +5,7 @@ const path = require('node:path') module.exports = (client) => { let commands = [] // only used for REST API - const foldersPath = path.join(__dirname, '../commands'); + const foldersPath = path.join(__dirname, '../commands/slash'); const commandFolders = fs.readdirSync(foldersPath); for (const folder of commandFolders) { // Grab all the command files from the commands directory you created earlier diff --git a/handlers/legacyCommands.js b/handlers/legacyCommands.js deleted file mode 100644 index 17d3119..0000000 --- a/handlers/legacyCommands.js +++ /dev/null @@ -1,29 +0,0 @@ -const fs = require('node:fs') -const path = require('node:path') -module.exports = (client) => { - // const legacyFoldersPath = path.join(__dirname, '../legacyCommands'); - // const legacyCommandFolders = fs.readdirSync(legacyFoldersPath); - // let legacyCount = 0 - // let aliasCount = 0 - // for (const folder of legacyCommandFolders) { - // const commandsPath = path.join(legacyFoldersPath, folder); - // const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); - // for (const file of commandFiles) { - // legacyCount++ - // const filePath = path.join(commandsPath, file); - // const command = require(filePath); - // if ('execute' in command) { - // client.legacyCommands.set(command.name, command); - // } - // if (command.aliases && Array.isArray(command.aliases)) { - // command.aliases.forEach(alias => { - // aliasCount++ - // client.aliases.set(alias, command.name) - // }) - // } - // } - // } - // console.log(`[${aliasCount}] Aliase(s) initialized`) - // console.log(`[${legacyCount}] Legacy Command(s) initialized`) - -} diff --git a/legacyCommands/test/ping.js b/legacyCommands/test/ping.js deleted file mode 100644 index d416c96..0000000 --- a/legacyCommands/test/ping.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - name: 'ping', - description: 'returns pong!', - aliases: [''], - async execute(message, args) { - message.reply('pong!') - } -} \ No newline at end of file