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
+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;