Moved Assets to Subdir, Migrated some old commands

This commit is contained in:
2026-04-06 21:27:16 +02:00
parent 5e8fb7e729
commit 2691653132
25 changed files with 263 additions and 162 deletions
+1 -1
View File
@@ -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 > 0) {
if (cooldown) {
content = `<t:${cooldown.cooldown}:R> 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...'
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = {
const cdData = await cdColl.findOne({ userID: message.author.id })
if (!cdData || cdData.cooldown < Date.now() / 1000) {
if (!cdData || cdData.cooldown < (Date.now() / 1000)) {
let cd = Math.floor((Date.now() + 3600000) / 1000)
await cdColl.findOneAndUpdate({
userID: message.author.id
@@ -40,7 +40,7 @@ module.exports = {
})
} else {
return await message.reply({
content: `Du kannst erst <t:${Math.floor(cdData?.cooldown / 1000)}:R> wieder nussen :(`,
content: `Du kannst erst <t:${Math.floor(cdData?.cooldown)}:R> wieder nussen :(`,
})
}
},
+2 -2
View File
@@ -1,4 +1,4 @@
const { EmbedBuilder, MessageFlags } = require('discord.js')
const { EmbedBuilder } = require('discord.js')
const { mClient } = require('../../../index')
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config()
@@ -58,7 +58,7 @@ module.exports = {
if (yourBalance.nuts < amount) {
return await message.reply({
content: 'Du kannst nicht mehr geben als du hast!',
flags: MessageFlags.Ephemeral
ephemeral: true
})
}
var content = `Du sendest **${amount}** Nüsse an <@${target.id}>`
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = {
})
const embed = new EmbedBuilder()
.setTitle('Nuts Leaderboard')
.setThumbnail(message.guild.iconURL({ dynamic: true}))
.setThumbnail('https://cdn.discordapp.com/attachments/1152723542836772914/1152940755539722240/pngwing.com.png')
.setDescription(fields.toString())
.setColor('#5865F2') // Discord's blurple color
.setFooter({ text: 'Use ◄ ► to navigate' });
-58
View File
@@ -1,58 +0,0 @@
const { EmbedBuilder } = require('discord.js')
const { mClient } = require('../../../index')
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
require('dotenv').config()
module.exports = {
name: 'nutsstats',
description: 'shows nuts statistic',
aliases: ['nstat', 'ns'],
async execute(message, args) {
const db = mClient.db(process.env.M_DB)
const nStatsColl = db.collection('stats_nuts')
const stats = await nStatsColl.find({}).sort({ amount: 1 }).toArray()
let nutMin = {
count: 0,
amount: 0
}
let nutMax = {
count: 0,
amount: 0
}
let totalNuts = 0
let totalCount = 0
stats.forEach(stat => {
totalCount += stat.count
totalNuts += (stat.count * stat.amount)
if (nutMin.count > stat.count) { nutMin = stat }
if (nutMax.count < stat.count) { nutMax = stat }
})
let nutAvg = totalNuts / totalCount
const embed = new EmbedBuilder()
.setTitle("Nut Statistic")
.setDescription(
`Total Nut Actions: **${totalCount}**\r\n
Total Nuts nutted: **${totalNuts}**\r\n
Nut Average: **${nutAvg.toFixed(3)}**\r\n
Best Nut: **${nutMax.amount}**\r\n
Worst Nut: **${nutMin.amount}**`
)
.addFields(
{ name: '[0]', value: `x${stats[0].count}`, inline: true },
{ name: '[1]', value: `x${stats[1].count}`, inline: true },
{ name: '[2]', value: `x${stats[2].count}`, inline: true },
{ name: '[3]', value: `x${stats[3].count}`, inline: true },
{ name: '[4]', value: `x${stats[4].count}`, inline: true },
{ name: '[5]', value: `x${stats[5].count}`, inline: true },
{ name: '[6]', value: `x${stats[6].count}`, inline: true },
{ name: '[7]', value: `x${stats[7].count}`, inline: true },
{ name: '[8]', value: `x${stats[8].count}`, inline: true },
{ name: '[9]', value: `x${stats[9].count}`, inline: true }
)
.setColor(0x51267)
.setTimestamp()
.setThumbnail(message.guild.iconURL())
await message.reply({
embeds: [embed]
})
}
}
+22 -84
View File
@@ -7,7 +7,7 @@ function isValidDate(day, month) {
// Define the number of days in each month
const daysInMonth = {
1: 31, // January
2: 28, // February (ignore leap years)
2: 28, // February (fuck leap years, me an' the homies hate that)
3: 31, // March
4: 30, // April
5: 31, // May
@@ -32,7 +32,22 @@ function isValidDate(day, month) {
return true;
}
async function birthdayAdd(interaction) {
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
}
async function birthdaySet(interaction) {
let target = await interaction.options.getUser('user')
let day = await interaction.options.getNumber('day')
let month = await interaction.options.getNumber('month')
@@ -90,49 +105,6 @@ async function birthdayDelete(interaction) {
return interaction.reply({ content: "There was an issue!" })
}
}
async function birthdayEdit(interaction) {
let target = await interaction.options.getUser('user')
let day = await interaction.options.getNumber('day')
let month = await interaction.options.getNumber('month')
if (!isValidDate(day, month)) {
return interaction.reply({ content: "Invalid Date", flags: MessageFlags.Ephemeral })
}
const db = mClient.db(process.env.M_DB)
const bdayColl = db.collection('items_birthdays')
const found = await bdayColl.findOne({ userID: target.id })
if (!found) {
return interaction.reply({ content: "Not yet in Database", flags: MessageFlags.Ephemeral })
}
const data = {
guildID: interaction.guild.id,
userID: target.id,
day: day,
month: month
}
const res = await bdayColl.findOneAndUpdate({ userID: target.id }, { $set: data }, { upsert: true })
return interaction.reply({ content: "Birthday edited successfully!" })
}
async function makeTimestamp(day, month, year) {
const date = new Date(year, month - 1, day);
const unixTimestamp = Math.floor(date.getTime() / 1000);
return unixTimestamp
}
function isToday(day, month) {
const currentYear = new Date().getFullYear();
const inputDate = new Date(currentYear, month - 1, day);
const today = new Date();
return (
inputDate.getDate() === today.getDate() &&
inputDate.getMonth() === today.getMonth() &&
inputDate.getFullYear() === today.getFullYear()
);
}
async function birthdayGet(interaction) {
const target = await interaction.options.getUser('user');
const db = mClient.db(process.env.M_DB);
@@ -141,7 +113,7 @@ async function birthdayGet(interaction) {
const found = await bdayColl.findOne({ userID: target.id });
if (!found) {
return interaction.reply({
content: "Not in Database!",
content: "Date not in Database!",
flags: MessageFlags.Ephemeral
});
}
@@ -167,21 +139,6 @@ async function birthdayGet(interaction) {
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 = {
data: new SlashCommandBuilder()
@@ -189,8 +146,8 @@ module.exports = {
.setDescription('manage birthdays')
.addSubcommand(s =>
s
.setName('add')
.setDescription('adds a birthday')
.setName('set')
.setDescription('set date to birthday')
.addUserOption((option) =>
option
.setName('user')
@@ -219,16 +176,6 @@ module.exports = {
option.setName('user').setDescription('user'))
.addStringOption((option) =>
option.setName('id').setDescription('ID')))
.addSubcommand(s =>
s
.setName('edit')
.setDescription('edits a birthday')
.addUserOption((option) =>
option.setName('user').setDescription('user').setRequired(true))
.addNumberOption((option) =>
option.setName('day').setDescription('day').setRequired(true))
.addNumberOption((option) =>
option.setName('month').setDescription('month').setRequired(true)))
.addSubcommand(s =>
s
.setName('get')
@@ -237,14 +184,14 @@ module.exports = {
option.setName('user').setDescription('user').setRequired(true))),
async execute(interaction) {
switch (interaction.options._subcommand) {
case 'add':
case 'set':
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
return await interaction.reply({
content: "Unprivileged Access!",
flags: MessageFlags.Ephemeral
})
}
birthdayAdd(interaction)
birthdaySet(interaction)
break;
case 'delete':
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
@@ -255,15 +202,6 @@ module.exports = {
}
birthdayDelete(interaction)
break;
case 'edit':
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
return await interaction.reply({
content: "Unprivileged Access!",
flags: MessageFlags.Ephemeral
})
}
birthdayEdit(interaction)
break;
case 'get':
birthdayGet(interaction)
break;
+23 -5
View File
@@ -214,7 +214,7 @@ async function nutsCooldown(interaction) {
let date = (Date.now() / 1000)
if (cooldown.cooldown > date) {
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://img.freepik.com/free-vector/no-nut-november-cartoon-illustration-premium-cartoon-vector-icon-illustration-food-object-isolated_138676-6549.jpg'
title = 'To Nut or Not to Nut...'
}
@@ -227,7 +227,7 @@ async function nutsCooldown(interaction) {
embeds: [embed]
})
}
async function nutsNut(interaction) {
async function nutsNut(interaction, quickMode) {
const db = mClient.db(process.env.M_DB)
const nutsColl = db.collection('items_nuts')
const cdColl = db.collection('items_cooldowns')
@@ -243,7 +243,7 @@ async function nutsNut(interaction) {
"normal": 'https://c8.alamy.com/comp/PPPBXK/surprised-pecan-nuts-pile-on-plate-cartoon-PPPBXK.jpg',
"low": 'https://as2.ftcdn.net/v2/jpg/02/24/65/37/1000_F_224653769_ceJk0tq9UT1hSu5FIVUi7BeaN4ucSZGv.jpg',
"none": 'https://cdn4.vectorstock.com/i/1000x1000/87/08/afraid-pecan-nuts-pile-on-plate-cartoon-vector-22028708.jpg',
"onCD": 'https://cdn.discordapp.com/attachments/1152723542836772914/1152987472788193361/No-nuts-PhotoRoom.png-PhotoRoom.png'
"onCD": 'https://img.freepik.com/free-vector/no-nut-november-cartoon-illustration-premium-cartoon-vector-icon-illustration-food-object-isolated_138676-6549.jpg'
}
let image
if (!cdData || cdData.cooldown < (Date.now() / 1000)) {
@@ -289,17 +289,26 @@ async function nutsNut(interaction) {
image = images["none"]
}
if (quickMode) {
return interaction.editReply({
content: `Du hast ${amount} Nüsse bekommen! :chestnut:`,
})
}
} else {
content = `Du kannst erst <t:${Math.floor(cdData?.cooldown)}:R> wieder nussen :(`
image = images["onCD"]
await delay(1000)
embed.setDescription(content)
embed.setThumbnail(image)
embed.setImage(null)
return await interaction.editReply({
embeds: [embed]
})
}
await interaction.editReply({
embeds: [embed]
})
@@ -348,7 +357,12 @@ module.exports = {
.addSubcommand(s =>
s
.setName('nut')
.setDescription('willst du nuss?')),
.setDescription('willst du nuss?'))
.addSubcommand(s =>
s.setName('quick')
.setDescription('A quick nut, mlord?')
),
async execute(interaction) {
switch (interaction.options._subcommand) {
case 'give':
@@ -372,7 +386,11 @@ module.exports = {
break;
case 'nut':
await interaction.deferReply()
nutsNut(interaction)
nutsNut(interaction, false)
break;
case 'quick':
await interaction.deferReply()
nutsNut(interaction, true)
break;
default:
break;
+7 -7
View File
@@ -176,7 +176,7 @@ async function quotesRandom(interaction) {
]).toArray()
}
const found = rdm[0]
if (!found) { return await interaction.reply({ content: 'Database Empty', flags: MessageFlags.Ephemeral }) }
if (!found) { return await interaction.reply({ content: 'No Entry Found.', flags: MessageFlags.Ephemeral }) }
const guild = await interaction.client.guilds.fetch(found.guildID)
const channel = await guild.channels.fetch(found.channelID)
const message = await channel.messages.fetch(found.messageID)
@@ -273,7 +273,7 @@ async function quotesLeaderboard(interaction) {
let skip = 0
const minValue = 0
const maxValue = await quotesColl.countDocuments({ $and: [{ guildID: interaction.guild.id }, { count: { $gt: 0 } }] })
const quotesData = await quotesColl.find({}).sort({ count: -1, messageID: -1 }).skip(skip).limit(5).toArray()
const fields = []
@@ -282,20 +282,20 @@ async function quotesLeaderboard(interaction) {
let channel = await guild.channels.fetch(data.channelID)
let message = await channel.messages.fetch(data.messageID)
await delay(500)
let timestamp = new Date(message.createdTimestamp)
fields.push({
name: `${index + 1}.`,//`\u200b` ,
value: `[#${data.messageID}](https://discord.com/channels/${data.guildID}/${data.channelID}/${data.messageID})\r\n**by** <@${data.by}> • ⭐ ${data.count}\r\n_Posted on **${timestamp}**_\r\n${message.content}`
})
})
await delay(5000)
console.log(fields)
quotesData.sort((a,b) => {
quotesData.sort((a, b) => {
const numA = parseInt(a.name);
const numB = parseInt(b.name);
return numA - numB;
+48
View File
@@ -0,0 +1,48 @@
const { SlashCommandBuilder } = require("discord.js");
function askMyBalls() {
var answers = [
'Absolut, so wie die Authorität unserer Göttin!',
'Unterschätze es nicht, genauso wie Roberts sexual frustration',
'Ich zedaz so',
'Ohne Zweifel',
'Definitiv, Alter',
'Microsoft Outlook gut',
'Das Sternzeichen von Yeesh leuchtet heute stark dafür',
'Mit "Support-Desk am Freitagabend" - Wahrscheinlichkeit',
'Ist die Nase von Julius wunderschön und lang?',
'So wahr wie Laviis Zeichnkünste',
'nein...ja... vielleicht?',
'Frag mich nachher nochmal',
'Die Kalkulationen sind leicht off, ich aber nicht ;)',
'Ich sag es dir ein ander Mal',
'Ohne schwere Zeiten, würden wir die guten Zeiten nie schätzen',
'Genauso schlecht wie eine Ketzerei gegen den Olymp',
'Hat der Fuchs uns jemals verraten?...**hust**',
'Mein Outlook ist abgeschmiert, mist',
'Ich bezweifle es. A propos, zweifel nicht an den Götter und ihren Priester!',
'Meine Quellen sagen.... WARNUNG! Artikel 17: Die betroffene Person hat das Recht, von dem Verantwortlichen zu verlangen, dass sie betreffende personenbezogene Daten unverzüglich gelöscht werden, und der Verantwortliche ist verpflichtet, personenbezogene Daten unverzüglich zu löschen, sofern einer der folgenden Gründe zutrifft **ERROR ERROR ERROR**?'
]
const r = Math.floor(Math.random() * answers.length)
return answers[r]
}
function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
module.exports = {
data: new SlashCommandBuilder()
.setName('8ball')
.setDescription('dont ask me anything')
.addSubcommand(s =>
s.setName('ask')
.setDescription('what do you want to know?')
.addStringOption(
o => o.setName('question').setDescription('ask away!').setRequired(true))
),
async execute(interaction) {
await interaction.deferReply()
await delay(2000)
await interaction.editReply(askMyBalls())
}
}
View File
+83
View File
@@ -0,0 +1,83 @@
const { SlashCommandBuilder, EmbedBuilder, AttachmentBuilder } = require("discord.js");
async function doggoPet(interaction) {
const responses = [
'*loving growl*',
'Danke, das habe ich gebraucht.',
'Ein bisschen tiefer.',
'Ja, genau dort!'
]
var r = Math.floor(Math.random() * responses.length)
const filePath = `assets/Command_Doggo/doggo.jpg`;
const attachment = new AttachmentBuilder(filePath);
const embed = new EmbedBuilder()
.setDescription(responses[r])
.setColor(0x51267)
.setTimestamp()
.setImage(`attachment://doggo.jpg`);
await interaction.editReply({
embeds: [embed],
files: [attachment]
})
}
async function doggoFeed(interaction) {
await interaction.editReply({
content: 'WIP placeholder'
})
}
async function doggoWalk(interaction) {
await interaction.editReply({
content: 'WIP placeholder'
})
}
async function doggoPlay(interaction) {
await interaction.editReply({
content: 'WIP placeholder'
})
}
module.exports = {
data: new SlashCommandBuilder()
.setName('doggo')
.setDescription('who is a good boi?')
.addSubcommand(s =>
s.setName('pet')
.setDescription('beeg scratch')
)
.addSubcommand(s =>
s.setName('feed')
.setDescription('tastge')
)
.addSubcommand(s =>
s.setName('walk')
.setDescription('walkies')
)
.addSubcommand(s =>
s.setName('play')
.setDescription('fun time')
),
async execute(interaction) {
await interaction.deferReply()
switch (interaction.options._subcommand) {
case 'pet':
doggoPet(interaction)
break;
case 'feed':
doggoFeed(interaction)
break;
case 'walk':
doggoWalk(interaction)
break;
case 'play':
doggoPlay(interaction)
break;
default:
break;
}
}
}
View File
View File
+72
View File
@@ -0,0 +1,72 @@
const { SlashCommandBuilder, AttachmentBuilder, EmbedBuilder } = require('discord.js');
const fs = require('fs/promises');
const path = require('path');
async function makeDay() {
const date = new Date();
const tage = [
'sonntag',
'montag',
'dienstag',
'mittwoch',
'donnerstag',
'freitag',
'samstag'
];
const text = {
montag: 'Es ist Montag meine Münmler!',
mittwoch: 'Es ist Mittwoch meine Kerle!',
donnerstag: 'Es ist nicht mehr Mittwoch meine Kerle!',
freitag: 'Es ist Freitag meine Kerl*innen!',
default: 'Es ist nicht Mittwoch, meine Kerle...'
};
const today = tage[date.getDay()];
let files;
try {
files = await fs.readdir('assets/Command_Mittwoch');
} catch (err) {
console.error(err);
return { filename: 'nicht_mittwoch', content: text.default };
}
const available = files.map(f => path.parse(f).name);
if (available.includes(today)) {
return {
filename: today,
content: text[today] || text.default
};
}
return {
filename: 'nicht_mittwoch',
content: text.default
};
}
module.exports = {
data: new SlashCommandBuilder()
.setName('mittwoch')
.setDescription('mittwoch vibes'),
async execute(interaction) {
const { filename, content } = await makeDay();
const filePath = `assets/Command_Mittwoch/${filename}.jpg`;
const attachment = new AttachmentBuilder(filePath);
const embed = new EmbedBuilder()
.setTitle(content)
.setColor(0x51267)
.setTimestamp()
.setImage(`attachment://${filename}.jpg`);
await interaction.reply({
embeds: [embed],
files: [attachment]
});
}
};