migrated
This commit is contained in:
@@ -168,9 +168,9 @@ async function nutsStats(interaction) {
|
||||
var type = interaction?.options?.getString('type') || 'lookup'
|
||||
var target = interaction?.options?.getUser('lookup') || {}
|
||||
|
||||
if(type == 'global') {
|
||||
if (type == 'global') {
|
||||
target.id = '__global'
|
||||
} else if (!target?.id){
|
||||
} else if (!target?.id) {
|
||||
target = interaction.user
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ async function nutsNut(interaction, quickMode) {
|
||||
const formatNut = (amount) => `${amount} ${amount === 1 ? 'Nuss' : 'Nüsse'}`
|
||||
|
||||
// check cooldown
|
||||
if (cdData || cdData?.cooldown > Date.now() / 1000) {
|
||||
if (cdData?.cooldown > Date.now() / 1000) {
|
||||
// on cooldown
|
||||
embed.setTitle('To Nut or Not to Nut...')
|
||||
embed.setDescription(`<t:${Math.floor(cdData.cooldown)}:R> kannst du wieder nussen! ;)`)
|
||||
@@ -298,18 +298,7 @@ async function nutsNut(interaction, quickMode) {
|
||||
}
|
||||
embed.setDescription('\u200B')
|
||||
// pseudo animation
|
||||
embed.setThumbnail(assets.box)
|
||||
await interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}nuts_box.png`]
|
||||
})
|
||||
await delay(1337)
|
||||
embed.setThumbnail(assets.explosion)
|
||||
await interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}nuts_explosion.gif`]
|
||||
})
|
||||
await delay(1337)
|
||||
|
||||
|
||||
// set 1 hour cooldown
|
||||
const cd = Math.floor((Date.now() + 3600000) / 1000)
|
||||
@@ -346,23 +335,40 @@ async function nutsNut(interaction, quickMode) {
|
||||
{ upsert: true }
|
||||
)
|
||||
|
||||
let assetFile
|
||||
if (amount === 0) assetFile = assets.none
|
||||
else if (amount > 8) assetFile = assets.high
|
||||
else if (amount > 4) assetFile = assets.normal
|
||||
else assetFile = assets.low
|
||||
|
||||
embed.setTitle(`Du hast ${formatNut(amount)} bekommen!`)
|
||||
embed.setThumbnail(assetFile)
|
||||
|
||||
if (quickMode) {
|
||||
return interaction.editReply({ content: `Du hast ${formatNut(amount)} bekommen! :chestnut:` })
|
||||
} else {
|
||||
embed.setImage(assets.box)
|
||||
await interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}nuts_box.png`]
|
||||
})
|
||||
await delay(1337)
|
||||
embed.setImage(assets.explosion)
|
||||
await interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}nuts_explosion.gif`]
|
||||
})
|
||||
await delay(1337)
|
||||
|
||||
let assetFile
|
||||
if (amount === 0) assetFile = assets.none
|
||||
else if (amount > 8) assetFile = assets.high
|
||||
else if (amount > 4) assetFile = assets.normal
|
||||
else assetFile = assets.low
|
||||
|
||||
embed.setTitle(`Du hast ${formatNut(amount)} bekommen!`)
|
||||
embed.setThumbnail(assetFile)
|
||||
embed.setImage(null)
|
||||
|
||||
return interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}${assetFile.split('://')[1]}`]
|
||||
})
|
||||
}
|
||||
|
||||
return interaction.editReply({
|
||||
embeds: [embed],
|
||||
files: [`${asset_path}${assetFile.split('://')[1]}`]
|
||||
})
|
||||
|
||||
}
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
@@ -446,4 +452,4 @@ module.exports = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user