Moved Assets to Subdir, Migrated some old commands
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user