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