clean slate, birthday fix
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Honors Leaderboard')
|
.setTitle('Honors Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Honors Leaderboard')
|
.setTitle('Honors Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Honors Leaderboard')
|
.setTitle('Honors Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Nuts Leaderboard')
|
.setTitle('Nuts Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Nuts Leaderboard')
|
.setTitle('Nuts Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Nuts Leaderboard')
|
.setTitle('Nuts Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -50,12 +50,15 @@ module.exports = {
|
|||||||
{ $inc: { [`stat.${amount}`]: 1 } },
|
{ $inc: { [`stat.${amount}`]: 1 } },
|
||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
)
|
)
|
||||||
let content = `Du hast ${amount} Nüsse bekommen! :chestnut:`
|
// Helper for singular/plural
|
||||||
if (!amount) {
|
const formatNut = (amount) => `${amount === 1 ? 'eine' : amount} ${amount === 1 ? 'Nuss' : 'Nüsse'}`
|
||||||
content = `Du hast leider keine Nüsse bekommen :(`
|
|
||||||
|
let nutText = `Du hast ${formatNut(amount)} bekommen! :chestnut:`
|
||||||
|
if (amount <= 0) {
|
||||||
|
nutText = `Du hast keine Nuss bekommen! :yoink_help:`
|
||||||
}
|
}
|
||||||
return await message.reply({
|
return await message.reply({
|
||||||
content: content
|
content: nutText
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Nuts Leaderboard')
|
.setTitle('Nuts Leaderboard')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(message.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const { SlashCommandBuilder, EmbedBuilder, MessageFlags } = require('discord.js')
|
const { SlashCommandBuilder, EmbedBuilder, MessageFlags, PermissionFlagsBits } = require('discord.js')
|
||||||
const { mClient } = require('../../../index')
|
const { mClient } = require('../../../index')
|
||||||
const { configDotenv } = require('dotenv')
|
const { configDotenv } = require('dotenv')
|
||||||
configDotenv()
|
configDotenv()
|
||||||
@@ -144,6 +144,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('birthday')
|
.setName('birthday')
|
||||||
.setDescription('manage birthdays')
|
.setDescription('manage birthdays')
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
|
||||||
.addSubcommand(s =>
|
.addSubcommand(s =>
|
||||||
s
|
s
|
||||||
.setName('set')
|
.setName('set')
|
||||||
@@ -185,21 +186,9 @@ module.exports = {
|
|||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
switch (interaction.options._subcommand) {
|
switch (interaction.options._subcommand) {
|
||||||
case 'set':
|
case 'set':
|
||||||
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
|
|
||||||
return await interaction.reply({
|
|
||||||
content: "Unprivileged Access!",
|
|
||||||
flags: MessageFlags.Ephemeral
|
|
||||||
})
|
|
||||||
}
|
|
||||||
birthdaySet(interaction)
|
birthdaySet(interaction)
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
|
|
||||||
return await interaction.reply({
|
|
||||||
content: "Unprivileged Access!",
|
|
||||||
flags: MessageFlags.Ephemeral
|
|
||||||
})
|
|
||||||
}
|
|
||||||
birthdayDelete(interaction)
|
birthdayDelete(interaction)
|
||||||
break;
|
break;
|
||||||
case 'get':
|
case 'get':
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const { SlashCommandBuilder, Events, MessageFlags } = require('discord.js')
|
const { SlashCommandBuilder, Events, MessageFlags, PermissionFlagsBits } = require('discord.js')
|
||||||
const { mClient } = require('../../../index')
|
const { mClient } = require('../../../index')
|
||||||
require('dotenv').config()
|
require('dotenv').config()
|
||||||
|
|
||||||
@@ -80,6 +80,7 @@ module.exports = {
|
|||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('config')
|
.setName('config')
|
||||||
.setDescription('configurations for admins')
|
.setDescription('configurations for admins')
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageChannels)
|
||||||
.addSubcommandGroup(sg =>
|
.addSubcommandGroup(sg =>
|
||||||
sg
|
sg
|
||||||
.setName('channels')
|
.setName('channels')
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ async function honorLeaderboard(interaction) {
|
|||||||
})
|
})
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('- Honors Leaderboard -')
|
.setTitle('- Honors Leaderboard -')
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true}))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2') // Discord's blurple color
|
.setColor('#5865F2') // Discord's blurple color
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' });
|
.setFooter({ text: 'Use ◄ ► to navigate' });
|
||||||
|
|||||||
@@ -150,15 +150,14 @@ async function nutsLeaderboard(interaction) {
|
|||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle('Nuts Leaderboard')
|
.setTitle('Nuts Leaderboard')
|
||||||
.setThumbnail('attachment://nuts_main.png')
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true}))
|
||||||
.setDescription(fields.toString())
|
.setDescription(fields.toString())
|
||||||
.setColor('#5865F2')
|
.setColor('#5865F2')
|
||||||
.setFooter({ text: 'Use ◄ ► to navigate' })
|
.setFooter({ text: 'Use ◄ ► to navigate' })
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
components: [row],
|
components: [row]
|
||||||
files: [`${asset_path}nuts_main.png`]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +280,7 @@ async function nutsNut(interaction, quickMode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper for singular/plural
|
// 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
|
// check cooldown
|
||||||
if (cdData?.cooldown > Date.now() / 1000) {
|
if (cdData?.cooldown > Date.now() / 1000) {
|
||||||
@@ -330,9 +329,13 @@ async function nutsNut(interaction, quickMode) {
|
|||||||
{ upsert: true }
|
{ upsert: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let nutText = `Du hast ${formatNut(amount)} bekommen! :chestnut:`
|
||||||
|
if (amount <= 0) {
|
||||||
|
nutText = `Du hast keine Nuss bekommen! :yoink_help:`
|
||||||
|
}
|
||||||
|
|
||||||
if (quickMode) {
|
if (quickMode) {
|
||||||
return interaction.editReply({ content: `Du hast ${formatNut(amount)} bekommen! :chestnut:` })
|
return interaction.editReply({ content: nutText })
|
||||||
}
|
}
|
||||||
|
|
||||||
// pseudo animation
|
// pseudo animation
|
||||||
@@ -355,7 +358,7 @@ async function nutsNut(interaction, quickMode) {
|
|||||||
else if (amount > 4) assetFile = assets.normal
|
else if (amount > 4) assetFile = assets.normal
|
||||||
else assetFile = assets.low
|
else assetFile = assets.low
|
||||||
|
|
||||||
embed.setTitle(`Du hast ${formatNut(amount)} bekommen!`)
|
embed.setTitle(nutText)
|
||||||
embed.setThumbnail(assetFile)
|
embed.setThumbnail(assetFile)
|
||||||
embed.setImage(null)
|
embed.setImage(null)
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ module.exports = {
|
|||||||
console.error(`Failed to add birthday role to ${member.user.tag}:`, err)
|
console.error(`Failed to add birthday role to ${member.user.tag}:`, err)
|
||||||
);
|
);
|
||||||
console.log(`Added birthday role to ${member.user.tag}`);
|
console.log(`Added birthday role to ${member.user.tag}`);
|
||||||
//client.emit('Birthday', member);
|
client.emit('Birthday', member);
|
||||||
} else {
|
} else {
|
||||||
// Default fallback: remove birthday role if present
|
// Default fallback: remove birthday role if present
|
||||||
if (member.roles.cache.has(birthdayRoleID)) {
|
if (member.roles.cache.has(birthdayRoleID)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user