moved to subdir

This commit is contained in:
2026-04-06 20:07:58 +02:00
parent f1f9d95685
commit 5e8fb7e729
28 changed files with 83 additions and 77 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

@@ -1,5 +1,5 @@
const { EmbedBuilder } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const { mClient } = require('../../index') const { mClient } = require('../../../index')
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
@@ -1,5 +1,5 @@
const { EmbedBuilder } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const { mClient } = require('../../index') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
name: 'nutsCooldown', name: 'nutsCooldown',
@@ -13,7 +13,7 @@ module.exports = {
let content = `Du kannst wieder nussen! :)` let content = `Du kannst wieder nussen! :)`
let thumbnail = 'https://cdn-icons-png.flaticon.com/512/7451/7451659.png' let thumbnail = 'https://cdn-icons-png.flaticon.com/512/7451/7451659.png'
let title = 'Go Nuts!' let title = 'Go Nuts!'
if (cooldown) { if (cooldown > 0) {
content = `<t:${cooldown.cooldown}:R> kannst du wieder nussen! ;)` content = `<t:${cooldown.cooldown}:R> kannst du wieder nussen! ;)`
thumbnail = 'https://cdn.discordapp.com/attachments/1152723542836772914/1152987472788193361/No-nuts-PhotoRoom.png-PhotoRoom.png' thumbnail = 'https://cdn.discordapp.com/attachments/1152723542836772914/1152987472788193361/No-nuts-PhotoRoom.png-PhotoRoom.png'
title = 'To Nut or Not to Nut...' title = 'To Nut or Not to Nut...'
@@ -1,4 +1,4 @@
const { mClient } = require('../../index') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
name: 'nuts', name: 'nuts',
@@ -1,5 +1,5 @@
const { EmbedBuilder, MessageFlags } = require('discord.js') const { EmbedBuilder, MessageFlags } = require('discord.js')
const { mClient } = require('../../index') const { mClient } = require('../../../index')
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
@@ -1,5 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js') 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)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
@@ -37,7 +37,7 @@ module.exports = {
}) })
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle('Nuts Leaderboard') .setTitle('Nuts Leaderboard')
.setThumbnail('https://cdn.discordapp.com/attachments/1152723542836772914/1152940755539722240/pngwing.com.png') .setThumbnail(message.guild.iconURL({ dynamic: true}))
.setDescription(fields.toString()) .setDescription(fields.toString())
.setColor('#5865F2') // Discord's blurple color .setColor('#5865F2') // Discord's blurple color
.setFooter({ text: 'Use ◄ ► to navigate' }); .setFooter({ text: 'Use ◄ ► to navigate' });
@@ -1,5 +1,5 @@
const { EmbedBuilder } = require('discord.js') const { EmbedBuilder } = require('discord.js')
const { mClient } = require('../../index') const { mClient } = require('../../../index')
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config() require('dotenv').config()
module.exports = { module.exports = {
@@ -1,5 +1,5 @@
const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js') const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js')
const { mClient } = require('../..') const { mClient } = require('../../../index')
const { configDotenv } = require('dotenv') const { configDotenv } = require('dotenv')
configDotenv() configDotenv()
@@ -32,7 +32,6 @@ function isValidDate(day, month) {
return true; return true;
} }
async function birthdayAdd(interaction) { async function birthdayAdd(interaction) {
let target = await interaction.options.getUser('user') let target = await interaction.options.getUser('user')
let day = await interaction.options.getNumber('day') 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 }) const res = await bdayColl.findOneAndUpdate({ userID: target.id }, { $set: data }, { upsert: true })
return interaction.reply({ content: "Birthday edited successfully!" }) 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) { async function makeTimestamp(day, month, year) {
const date = new Date(year, month - 1, day); const date = new Date(year, month - 1, day);
const unixTimestamp = Math.floor(date.getTime() / 1000); const unixTimestamp = Math.floor(date.getTime() / 1000);
@@ -141,31 +134,53 @@ function isToday(day, month) {
); );
} }
async function birthdayGet(interaction) { async function birthdayGet(interaction) {
let target = await interaction.options.getUser('user') const target = await interaction.options.getUser('user');
const db = mClient.db(process.env.M_DB) const db = mClient.db(process.env.M_DB);
const bdayColl = db.collection('items_birthdays') const bdayColl = db.collection('items_birthdays');
const found = await bdayColl.findOne({ userID: target.id }) const found = await bdayColl.findOne({ userID: target.id });
if (!found) { 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)){ const now = new Date();
let nextYear = new Date().getFullYear() + 1 const isToday =
unix = await makeTimestamp(found.day,found.month, nextYear) now.getDate() === found.day &&
now.getMonth() === (found.month - 1);
let description;
if (isToday) {
description = `IS TODAY! 🥳🎉`;
} else { } else {
let thisYear = new Date().getFullYear() const unix = getNextBirthdayTimestamp(found.day, found.month);
unix = await makeTimestamp(found.day,found.month, thisYear) description = `is on the <t:${unix}:d>\n<t:${unix}:R>`;
}
let description = `is on the <t:${unix}:d>\r\n<t:${unix}:R>`
if(isToday(found.day, found.month)){
description = `IS TODAY!🥳🎉`
} }
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setThumbnail(target.displayAvatarURL()) .setThumbnail(target.displayAvatarURL())
.setTitle(`${target.globalName ? target.globalName: target.username}'s Birthday!`) .setTitle(`${target.globalName ?? target.username}'s Birthday...`)
.setDescription(description) .setDescription(description);
await interaction.reply({ embeds: [embed] })
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 = { module.exports = {
@@ -1,5 +1,5 @@
const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js') const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js')
const { mClient } = require('../..') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
async function channelSet(interaction) { async function channelSet(interaction) {
@@ -1,5 +1,5 @@
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js')
const { mClient } = require('../..') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
@@ -1,5 +1,5 @@
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require('discord.js') const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageFlags } = require('discord.js')
const { mClient } = require('../..') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
async function nutsGive(interaction) { async function nutsGive(interaction) {
@@ -128,7 +128,7 @@ async function nutsLeaderboard(interaction) {
}) })
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle('Nuts Leaderboard') .setTitle('Nuts Leaderboard')
.setThumbnail('https://cdn.discordapp.com/attachments/1152723542836772914/1152940755539722240/pngwing.com.png') .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setDescription(fields.toString()) .setDescription(fields.toString())
.setColor('#5865F2') // Discord's blurple color .setColor('#5865F2') // Discord's blurple color
.setFooter({ text: 'Use ◄ ► to navigate' }); .setFooter({ text: 'Use ◄ ► to navigate' });
@@ -3,7 +3,7 @@ Random By Year?
Counter (Leaderboard) Counter (Leaderboard)
*/ */
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js') const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, UserSelectMenuBuilder, MessageFlags } = require('discord.js')
const { mClient } = require('../..') const { mClient } = require('../../../index')
require('dotenv').config() require('dotenv').config()
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
View File
View File
View File
View File
View File
View File
+28
View File
@@ -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`)
}
@@ -5,7 +5,7 @@ const path = require('node:path')
module.exports = (client) => { module.exports = (client) => {
let commands = [] // only used for REST API 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); const commandFolders = fs.readdirSync(foldersPath);
for (const folder of commandFolders) { for (const folder of commandFolders) {
// Grab all the command files from the commands directory you created earlier // Grab all the command files from the commands directory you created earlier
-29
View File
@@ -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`)
}
-8
View File
@@ -1,8 +0,0 @@
module.exports = {
name: 'ping',
description: 'returns pong!',
aliases: [''],
async execute(message, args) {
message.reply('pong!')
}
}