clean slate, birthday fix

This commit is contained in:
2026-06-08 20:57:40 +02:00
parent bb90ca792c
commit 7bd44bd653
13 changed files with 29 additions and 33 deletions
+7 -4
View File
@@ -50,12 +50,15 @@ module.exports = {
{ $inc: { [`stat.${amount}`]: 1 } },
{ upsert: true }
)
let content = `Du hast ${amount} Nüsse bekommen! :chestnut:`
if (!amount) {
content = `Du hast leider keine Nüsse bekommen :(`
// Helper for singular/plural
const formatNut = (amount) => `${amount === 1 ? 'eine' : amount} ${amount === 1 ? 'Nuss' : 'Nüsse'}`
let nutText = `Du hast ${formatNut(amount)} bekommen! :chestnut:`
if (amount <= 0) {
nutText = `Du hast keine Nuss bekommen! :yoink_help:`
}
return await message.reply({
content: content
content: nutText
})
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = {
})
const embed = new EmbedBuilder()
.setTitle('Nuts Leaderboard')
.setThumbnail(guild.iconURL({ dynamic: true}))
.setThumbnail(message.guild.iconURL({ dynamic: true}))
.setDescription(fields.toString())
.setColor('#5865F2') // Discord's blurple color
.setFooter({ text: 'Use ◄ ► to navigate' });
+2 -13
View File
@@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js')
const { SlashCommandBuilder, EmbedBuilder, MessageFlags, PermissionFlagsBits } = require('discord.js')
const { mClient } = require('../../../index')
const { configDotenv } = require('dotenv')
configDotenv()
@@ -144,6 +144,7 @@ module.exports = {
data: new SlashCommandBuilder()
.setName('birthday')
.setDescription('manage birthdays')
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
.addSubcommand(s =>
s
.setName('set')
@@ -185,21 +186,9 @@ module.exports = {
async execute(interaction) {
switch (interaction.options._subcommand) {
case 'set':
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
return await interaction.reply({
content: "Unprivileged Access!",
flags: MessageFlags.Ephemeral
})
}
birthdaySet(interaction)
break;
case 'delete':
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
return await interaction.reply({
content: "Unprivileged Access!",
flags: MessageFlags.Ephemeral
})
}
birthdayDelete(interaction)
break;
case 'get':
+2 -1
View File
@@ -1,4 +1,4 @@
const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js')
const { SlashCommandBuilder, Events, MessageFlags, PermissionFlagsBits } = require('discord.js')
const { mClient } = require('../../../index')
require('dotenv').config()
@@ -80,6 +80,7 @@ module.exports = {
data: new SlashCommandBuilder()
.setName('config')
.setDescription('configurations for admins')
.setDefaultMemberPermissions(PermissionFlagsBits.ManageChannels)
.addSubcommandGroup(sg =>
sg
.setName('channels')
+1 -1
View File
@@ -103,7 +103,7 @@ async function honorLeaderboard(interaction) {
})
const embed = new EmbedBuilder()
.setTitle('- Honors Leaderboard -')
.setThumbnail(guild.iconURL({ dynamic: true}))
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
.setDescription(fields.toString())
.setColor('#5865F2') // Discord's blurple color
.setFooter({ text: 'Use ◄ ► to navigate' });
+9 -6
View File
@@ -150,15 +150,14 @@ async function nutsLeaderboard(interaction) {
const embed = new EmbedBuilder()
.setTitle('Nuts Leaderboard')
.setThumbnail('attachment://nuts_main.png')
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
.setDescription(fields.toString())
.setColor('#5865F2')
.setFooter({ text: 'Use ◄ ► to navigate' })
await interaction.editReply({
embeds: [embed],
components: [row],
files: [`${asset_path}nuts_main.png`]
components: [row]
})
}
@@ -281,7 +280,7 @@ async function nutsNut(interaction, quickMode) {
}
// Helper for singular/plural
const formatNut = (amount) => `${amount} ${amount === 1 ? 'Nuss' : 'Nüsse'}`
const formatNut = (amount) => `${amount === 1 ? 'eine' : amount} ${amount === 1 ? 'Nuss' : 'Nüsse'}`
// check cooldown
if (cdData?.cooldown > Date.now() / 1000) {
@@ -330,9 +329,13 @@ async function nutsNut(interaction, quickMode) {
{ upsert: true }
)
let nutText = `Du hast ${formatNut(amount)} bekommen! :chestnut:`
if (amount <= 0) {
nutText = `Du hast keine Nuss bekommen! :yoink_help:`
}
if (quickMode) {
return interaction.editReply({ content: `Du hast ${formatNut(amount)} bekommen! :chestnut:` })
return interaction.editReply({ content: nutText })
}
// pseudo animation
@@ -355,7 +358,7 @@ async function nutsNut(interaction, quickMode) {
else if (amount > 4) assetFile = assets.normal
else assetFile = assets.low
embed.setTitle(`Du hast ${formatNut(amount)} bekommen!`)
embed.setTitle(nutText)
embed.setThumbnail(assetFile)
embed.setImage(null)