add loop, and add categories to all commands

This commit is contained in:
Ayden Jahola 2025-09-20 01:22:31 +01:00
parent da481c6f01
commit 896f85136c
65 changed files with 170 additions and 27 deletions

View file

@ -12,6 +12,8 @@ module.exports = {
.setDescription("Your message to the AI") .setDescription("Your message to the AI")
.setRequired(true) .setRequired(true)
), ),
category: "AI",
async execute(interaction) { async execute(interaction) {
await interaction.deferReply(); // Defer initial response await interaction.deferReply(); // Defer initial response

View file

@ -8,6 +8,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("help") .setName("help")
.setDescription("Lists all available commands"), .setDescription("Lists all available commands"),
category: "Core",
async execute(interaction, client) { async execute(interaction, client) {
try { try {
@ -16,16 +17,19 @@ module.exports = {
); );
const serverName = interaction.guild.name; const serverName = interaction.guild.name;
const generalCommands = [];
const modCommands = [];
// Categorize commands // Group commands by category
const categories = {};
client.commands.forEach((command) => { client.commands.forEach((command) => {
const category = command.category || "Uncategorized"; // Default to "Uncategorized"
if (!categories[category]) {
categories[category] = [];
}
const commandLine = `/${command.data.name} - ${command.data.description}`; const commandLine = `/${command.data.name} - ${command.data.description}`;
if (!command.isModOnly) { // Check if command is mod-only and user has permissions
generalCommands.push(commandLine); if (!command.isModOnly || (command.isModOnly && isMod)) {
} else if (isMod) { categories[category].push(commandLine);
modCommands.push(`${commandLine} (Mods only)`);
} }
}); });
@ -43,47 +47,37 @@ module.exports = {
// Function to split commands into fields under 1024 characters // Function to split commands into fields under 1024 characters
const addCommandFields = (embed, commands, title) => { const addCommandFields = (embed, commands, title) => {
if (commands.length === 0) return;
let commandChunk = ""; let commandChunk = "";
let chunkCount = 1; let chunkCount = 1;
commands.forEach((command) => { commands.forEach((command) => {
// Check if adding this command will exceed the 1024 character limit if ((commandChunk + command + "\n").length > 1024) {
if ((commandChunk + command).length > 1024) {
// Add current chunk as a new field
embed.addFields({ embed.addFields({
name: `${title} (Part ${chunkCount})`, name: `${title} (Part ${chunkCount})`,
value: commandChunk, value: commandChunk,
}); });
commandChunk = ""; // Reset chunk for new field commandChunk = "";
chunkCount += 1; chunkCount += 1;
} }
// Append command to the current chunk
commandChunk += command + "\n"; commandChunk += command + "\n";
}); });
// Add any remaining commands in the last chunk
if (commandChunk) { if (commandChunk) {
embed.addFields({ embed.addFields({
name: `${title} (Part ${chunkCount})`, name: chunkCount > 1 ? `${title} (Part ${chunkCount})` : title,
value: commandChunk, value: commandChunk,
}); });
} }
}; };
// Add general commands in fields // Add commands for each category
if (generalCommands.length > 0) { for (const [categoryName, commands] of Object.entries(categories)) {
addCommandFields(helpEmbed, generalCommands, "General Commands"); addCommandFields(helpEmbed, commands, `${categoryName} Commands`);
} }
// Add mod-only commands in fields, if user is a mod await interaction.reply({ embeds: [helpEmbed] });
if (isMod && modCommands.length > 0) {
addCommandFields(helpEmbed, modCommands, "Mod-Only Commands");
}
// Send the single embed
await interaction.reply({
embeds: [helpEmbed],
});
} catch (error) { } catch (error) {
console.error("Error executing the help command:", error); console.error("Error executing the help command:", error);
await interaction.reply({ await interaction.reply({

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("invite") .setName("invite")
.setDescription("Provides an invite link to add the bot to your server."), .setDescription("Provides an invite link to add the bot to your server."),
category: "Core",
async execute(interaction, client) { async execute(interaction, client) {
try { try {

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("ping") .setName("ping")
.setDescription("Replies with Pong! and bot latency"), .setDescription("Replies with Pong! and bot latency"),
category: "Core",
async execute(interaction, client) { async execute(interaction, client) {
try { try {

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("uptime") .setName("uptime")
.setDescription("Shows how long the bot has been running"), .setDescription("Shows how long the bot has been running"),
category: "Core",
async execute(interaction, client) { async execute(interaction, client) {
try { try {

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("balance") .setName("balance")
.setDescription("Check your balance."), .setDescription("Check your balance."),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("daily") .setName("daily")
.setDescription("Claim your daily reward and start a streak!"), .setDescription("Claim your daily reward and start a streak!"),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -6,6 +6,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("inventory") .setName("inventory")
.setDescription("View your inventory with item rarity"), .setDescription("View your inventory with item rarity"),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -12,6 +12,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("sell") .setName("sell")
.setDescription("Sell an item from your inventory."), .setDescription("Sell an item from your inventory."),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -13,6 +13,7 @@ module.exports = {
.setDescription("The item you want to buy (use item name)") .setDescription("The item you want to buy (use item name)")
.setRequired(false) .setRequired(false)
), ),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -31,6 +31,7 @@ module.exports = {
.setDescription("Amount of coins to trade") .setDescription("Amount of coins to trade")
.setRequired(false) .setRequired(false)
), ),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("work") .setName("work")
.setDescription("Work to earn coins and experience random events!"), .setDescription("Work to earn coins and experience random events!"),
category: "Economy",
async execute(interaction) { async execute(interaction) {
const { user, guild } = interaction; const { user, guild } = interaction;

View file

@ -60,6 +60,8 @@ module.exports = {
{ name: "Monthly", value: "monthly" } { name: "Monthly", value: "monthly" }
) )
), ),
category: "Events",
async execute(interaction) { async execute(interaction) {
const name = interaction.options.getString("name"); const name = interaction.options.getString("name");
const description = interaction.options.getString("description"); const description = interaction.options.getString("description");

View file

@ -55,6 +55,7 @@ module.exports = {
{ name: "Monthly", value: "monthly" } { name: "Monthly", value: "monthly" }
) )
), ),
category: "Events",
async execute(interaction) { async execute(interaction) {
const name = interaction.options.getString("name"); const name = interaction.options.getString("name");

View file

@ -13,6 +13,7 @@ module.exports = {
.setDescription("Name of the event to join") .setDescription("Name of the event to join")
.setRequired(true) .setRequired(true)
), ),
category: "Events",
async execute(interaction) { async execute(interaction) {
const eventName = interaction.options.getString("event_name"); const eventName = interaction.options.getString("event_name");

View file

@ -12,6 +12,7 @@ module.exports = {
.setDescription("Name of the event to leave") .setDescription("Name of the event to leave")
.setRequired(true) .setRequired(true)
), ),
category: "Events",
async execute(interaction) { async execute(interaction) {
const eventName = interaction.options.getString("event_name"); const eventName = interaction.options.getString("event_name");

View file

@ -6,6 +6,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("listevents") .setName("listevents")
.setDescription("List all upcoming events."), .setDescription("List all upcoming events."),
category: "Events",
async execute(interaction) { async execute(interaction) {
const { user } = interaction; const { user } = interaction;

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("bored") .setName("bored")
.setDescription("Get a random activity to do."), .setDescription("Get a random activity to do."),
category: "Fun",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -49,6 +49,7 @@ module.exports = {
) )
.setRequired(false) .setRequired(false)
), ),
category: "Fun",
async execute(interaction) { async execute(interaction) {
const category = interaction.options.getString("category"); const category = interaction.options.getString("category");

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("randomfact") .setName("randomfact")
.setDescription("Get a random fun fact"), .setDescription("Get a random fun fact"),
category: "Fun",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -11,6 +11,8 @@ module.exports = {
.setDescription("The text to uwufy") .setDescription("The text to uwufy")
.setRequired(true) .setRequired(true)
), ),
category: "Fun",
async execute(interaction) { async execute(interaction) {
const inputText = interaction.options.getString("text"); const inputText = interaction.options.getString("text");

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("coinflip") .setName("coinflip")
.setDescription("Flip a coin!"), .setDescription("Flip a coin!"),
category: "Games",
async execute(interaction) { async execute(interaction) {
const result = Math.random() < 0.5 ? "Heads" : "Tails"; const result = Math.random() < 0.5 ? "Heads" : "Tails";

View file

@ -12,6 +12,7 @@ module.exports = {
.setMinValue(2) .setMinValue(2)
.setMaxValue(100) .setMaxValue(100)
), ),
category: "Games",
async execute(interaction) { async execute(interaction) {
const sides = interaction.options.getInteger("sides") || 6; const sides = interaction.options.getInteger("sides") || 6;

View file

@ -15,6 +15,7 @@ module.exports = {
{ name: "Scissors", value: "scissors" } { name: "Scissors", value: "scissors" }
) )
), ),
category: "Games",
async execute(interaction) { async execute(interaction) {
const userChoice = interaction.options.getString("choice"); const userChoice = interaction.options.getString("choice");

View file

@ -102,6 +102,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("scramble") .setName("scramble")
.setDescription("Play a word scramble game"), .setDescription("Play a word scramble game"),
category: "Games",
async execute(interaction) { async execute(interaction) {
const userId = interaction.user.id; const userId = interaction.user.id;

View file

@ -13,6 +13,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("spyfall") .setName("spyfall")
.setDescription("Start a game of Spyfall."), .setDescription("Start a game of Spyfall."),
category: "Games",
async execute(interaction) { async execute(interaction) {
const guildId = interaction.guild.id; const guildId = interaction.guild.id;

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("stopspyfall") .setName("stopspyfall")
.setDescription("Stop the current Spyfall game in this server."), .setDescription("Stop the current Spyfall game in this server."),
category: "Games",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -293,6 +293,7 @@ module.exports = {
})) }))
) )
), ),
category: "Games",
async execute(interaction, client) { async execute(interaction, client) {
const userId = interaction.user.id; const userId = interaction.user.id;

View file

@ -26,6 +26,8 @@ module.exports = {
.setDescription("Whether the response should be ephemeral") .setDescription("Whether the response should be ephemeral")
.setRequired(false) .setRequired(false)
), ),
category: "General",
async execute(interaction) { async execute(interaction) {
const word = interaction.options.getString("word").toLowerCase(); const word = interaction.options.getString("word").toLowerCase();
const isEphemeral = interaction.options.getBoolean("ephemeral") || false; const isEphemeral = interaction.options.getBoolean("ephemeral") || false;

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("thisdayinhistory") .setName("thisdayinhistory")
.setDescription("Shows historical events that happened on this day."), .setDescription("Shows historical events that happened on this day."),
category: "General",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -12,6 +12,8 @@ module.exports = {
.setDescription("The term to look up") .setDescription("The term to look up")
.setRequired(true) .setRequired(true)
), ),
category: "General",
async execute(interaction, client) { async execute(interaction, client) {
const term = interaction.options.getString("term").toLowerCase(); const term = interaction.options.getString("term").toLowerCase();
const guild = interaction.guild; const guild = interaction.guild;

View file

@ -83,6 +83,7 @@ module.exports = {
.setDescription("The word to find associations for") .setDescription("The word to find associations for")
.setRequired(true) .setRequired(true)
), ),
category: "General",
async execute(interaction) { async execute(interaction) {
const word = interaction.options.getString("word"); const word = interaction.options.getString("word");

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("botinfo") .setName("botinfo")
.setDescription("Displays information about the bot"), .setDescription("Displays information about the bot"),
category: "Information",
async execute(interaction, client) { async execute(interaction, client) {
try { try {

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("serverinfo") .setName("serverinfo")
.setDescription("Displays information about the server"), .setDescription("Displays information about the server"),
category: "Information",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -12,6 +12,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
), ),
isModOnly: true, isModOnly: true,
category: "Minecraft",
async execute(interaction) { async execute(interaction) {
const username = interaction.options.getString("username"); const username = interaction.options.getString("username");

View file

@ -9,6 +9,7 @@ module.exports = {
.setName("servers") .setName("servers")
.setDescription("Displays a list of servers the bot is currently in"), .setDescription("Displays a list of servers the bot is currently in"),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -15,6 +15,7 @@ module.exports = {
) )
.setRequired(true) .setRequired(true)
), ),
category: "Moderation",
async execute(interaction) { async execute(interaction) {
const serverSettings = await ServerSettings.findOne({ const serverSettings = await ServerSettings.findOne({

View file

@ -19,6 +19,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
let replySent = false; let replySent = false;

View file

@ -6,6 +6,7 @@ module.exports = {
.setName("clearleaderboard") .setName("clearleaderboard")
.setDescription("Clears all entries in the trivia leaderboard"), .setDescription("Clears all entries in the trivia leaderboard"),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -22,6 +22,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -27,6 +27,7 @@ module.exports = {
.setMaxValue(100) .setMaxValue(100)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -11,6 +11,7 @@ module.exports = {
.setDescription("Displays the current server settings"), .setDescription("Displays the current server settings"),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
let replySent = false; let replySent = false;

View file

@ -51,6 +51,7 @@ module.exports = {
) )
.setRequired(false) .setRequired(false)
), ),
category: "Moderation",
async execute(interaction) { async execute(interaction) {
// Check if the user has admin permissions // Check if the user has admin permissions

View file

@ -28,6 +28,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
let replySent = false; let replySent = false;

View file

@ -15,6 +15,7 @@ module.exports = {
.setRequired(false) .setRequired(false)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -22,6 +22,7 @@ module.exports = {
.setRequired(true) .setRequired(true)
), ),
isModOnly: true, isModOnly: true,
category: "Moderation",
async execute(interaction) { async execute(interaction) {
try { try {

71
commands/music/loop.js Normal file
View file

@ -0,0 +1,71 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("loop")
.setDescription("Loop the current song or entire queue")
.addStringOption((option) =>
option
.setName("mode")
.setDescription("Loop mode")
.setRequired(true)
.addChoices(
{ name: "Track (Current Song)", value: "track" },
{ name: "Queue (All Songs)", value: "queue" },
{ name: "Off (Disable Loop)", value: "off" }
)
),
category: "Music",
async execute(interaction, client) {
await interaction.deferReply();
const queue = client.distube.getQueue(interaction.guildId);
const mode = interaction.options.getString("mode");
if (!queue || !queue.songs.length) {
return interaction.followUp("❌ There is no music playing!");
}
try {
let modeValue;
let modeText;
switch (mode) {
case "track":
modeValue = 1;
modeText = "🔂 Track Loop";
break;
case "queue":
modeValue = 2;
modeText = "🔁 Queue Loop";
break;
case "off":
modeValue = 0;
modeText = "▶️ Loop Disabled";
break;
default:
modeValue = 0;
modeText = "▶️ Loop Disabled";
}
await queue.setRepeatMode(modeValue);
const embed = new EmbedBuilder()
.setColor("#0099ff")
.setTitle("🔁 Loop Mode Updated")
.setDescription(
`**${modeText}**\n\nCurrent song: **${queue.songs[0].name}**`
)
.setFooter({ text: `Requested by ${interaction.user.tag}` })
.setTimestamp();
await interaction.followUp({ embeds: [embed] });
} catch (error) {
console.error("Error setting loop mode:", error);
await interaction.followUp(
"❌ Failed to set loop mode. Please try again."
);
}
},
};

View file

@ -13,6 +13,8 @@ module.exports = {
.setDescription("Song name to search lyrics for (optional)") .setDescription("Song name to search lyrics for (optional)")
.setRequired(false) .setRequired(false)
), ),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
await interaction.deferReply(); await interaction.deferReply();

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("nowplaying") .setName("nowplaying")
.setDescription("Shows information about the current song"), .setDescription("Shows information about the current song"),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("pause") .setName("pause")
.setDescription("Pauses the current song"), .setDescription("Pauses the current song"),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);

View file

@ -10,6 +10,8 @@ module.exports = {
.setDescription("Song name or URL") .setDescription("Song name or URL")
.setRequired(true) .setRequired(true)
), ),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
await interaction.deferReply(); await interaction.deferReply();
const query = interaction.options.getString("query"); const query = interaction.options.getString("query");

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("queue") .setName("queue")
.setDescription("Shows the current music queue."), .setDescription("Shows the current music queue."),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);
if (!queue || queue.songs.length === 0) { if (!queue || queue.songs.length === 0) {

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("resume") .setName("resume")
.setDescription("Resumes the paused song"), .setDescription("Resumes the paused song"),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("shuffle") .setName("shuffle")
.setDescription("Shuffles the current queue"), .setDescription("Shuffles the current queue"),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("skip") .setName("skip")
.setDescription("Skips the current song."), .setDescription("Skips the current song."),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);
if (!queue) return interaction.reply("❌ No songs in queue!"); if (!queue) return interaction.reply("❌ No songs in queue!");

View file

@ -4,6 +4,8 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("stop") .setName("stop")
.setDescription("Stops the music and clears the queue."), .setDescription("Stops the music and clears the queue."),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);
if (!queue) return interaction.reply("❌ No music is playing!"); if (!queue) return interaction.reply("❌ No music is playing!");

View file

@ -12,6 +12,8 @@ module.exports = {
.setMinValue(1) .setMinValue(1)
.setMaxValue(100) .setMaxValue(100)
), ),
category: "Music",
async execute(interaction, client) { async execute(interaction, client) {
const volume = interaction.options.getInteger("level"); const volume = interaction.options.getInteger("level");
const queue = client.distube.getQueue(interaction.guildId); const queue = client.distube.getQueue(interaction.guildId);

View file

@ -11,6 +11,7 @@ module.exports = {
.setDescription("The Steam ID to fetch stats for.") .setDescription("The Steam ID to fetch stats for.")
.setRequired(true) .setRequired(true)
), ),
category: "Stats",
async execute(interaction) { async execute(interaction) {
const steamId = interaction.options.getString("steam_id"); const steamId = interaction.options.getString("steam_id");

View file

@ -13,6 +13,7 @@ module.exports = {
) )
.setRequired(true) .setRequired(true)
), ),
category: "Stats",
async execute(interaction) { async execute(interaction) {
const username = interaction.options.getString("username"); const username = interaction.options.getString("username");

View file

@ -41,6 +41,8 @@ module.exports = {
.setDescription("Include roles stats?") .setDescription("Include roles stats?")
.setRequired(false) .setRequired(false)
), ),
category: "Stats",
async execute(interaction) { async execute(interaction) {
// Immediately defer the reply // Immediately defer the reply
await interaction.deferReply(); await interaction.deferReply();

View file

@ -5,6 +5,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("leaderboard") .setName("leaderboard")
.setDescription("Displays the trivia leaderboard"), .setDescription("Displays the trivia leaderboard"),
category: "Utils",
async execute(interaction, client) { async execute(interaction, client) {
const guild = interaction.guild; const guild = interaction.guild;

View file

@ -4,6 +4,7 @@ module.exports = {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName("stats") .setName("stats")
.setDescription("Displays server statistics."), .setDescription("Displays server statistics."),
category: "Utils",
async execute(interaction) { async execute(interaction) {
try { try {

View file

@ -12,6 +12,7 @@ module.exports = {
.setDescription("Your verification code") .setDescription("Your verification code")
.setRequired(true) .setRequired(true)
), ),
category: "Verification",
async execute(interaction, client) { async execute(interaction, client) {
// Fetch server settings from the database // Fetch server settings from the database

View file

@ -21,6 +21,7 @@ module.exports = {
.setDescription("Your DCU email address") .setDescription("Your DCU email address")
.setRequired(true) .setRequired(true)
), ),
category: "Verification",
async execute(interaction, client) { async execute(interaction, client) {
// Fetch the server settings from the database using guild ID // Fetch the server settings from the database using guild ID

View file

@ -46,7 +46,7 @@ client.distube
`✅ Added: **${song.name}** - \`${song.formattedDuration}\`` `✅ Added: **${song.name}** - \`${song.formattedDuration}\``
); );
}) })
.on("error", (channel, error) => { .on("error", (queue, error) => {
console.error("DisTube error:", error); console.error("DisTube error:", error);
queue.textChannel.send("❌ An error occurred: " + error.message); queue.textChannel.send("❌ An error occurred: " + error.message);
}) })