diff --git a/commands/ai/chat.js b/commands/ai/chat.js index 66ddfce..4bcb1d4 100644 --- a/commands/ai/chat.js +++ b/commands/ai/chat.js @@ -12,6 +12,8 @@ module.exports = { .setDescription("Your message to the AI") .setRequired(true) ), + category: "AI", + async execute(interaction) { await interaction.deferReply(); // Defer initial response diff --git a/commands/core/help.js b/commands/core/help.js index ccde2c4..d4bcc98 100644 --- a/commands/core/help.js +++ b/commands/core/help.js @@ -8,6 +8,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("help") .setDescription("Lists all available commands"), + category: "Core", async execute(interaction, client) { try { @@ -16,16 +17,19 @@ module.exports = { ); const serverName = interaction.guild.name; - const generalCommands = []; - const modCommands = []; - // Categorize commands + // Group commands by category + const categories = {}; 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}`; - if (!command.isModOnly) { - generalCommands.push(commandLine); - } else if (isMod) { - modCommands.push(`${commandLine} (Mods only)`); + // Check if command is mod-only and user has permissions + if (!command.isModOnly || (command.isModOnly && isMod)) { + categories[category].push(commandLine); } }); @@ -43,47 +47,37 @@ module.exports = { // Function to split commands into fields under 1024 characters const addCommandFields = (embed, commands, title) => { + if (commands.length === 0) return; + let commandChunk = ""; let chunkCount = 1; commands.forEach((command) => { - // Check if adding this command will exceed the 1024 character limit - if ((commandChunk + command).length > 1024) { - // Add current chunk as a new field + if ((commandChunk + command + "\n").length > 1024) { embed.addFields({ name: `${title} (Part ${chunkCount})`, value: commandChunk, }); - commandChunk = ""; // Reset chunk for new field + commandChunk = ""; chunkCount += 1; } - // Append command to the current chunk commandChunk += command + "\n"; }); - // Add any remaining commands in the last chunk if (commandChunk) { embed.addFields({ - name: `${title} (Part ${chunkCount})`, + name: chunkCount > 1 ? `${title} (Part ${chunkCount})` : title, value: commandChunk, }); } }; - // Add general commands in fields - if (generalCommands.length > 0) { - addCommandFields(helpEmbed, generalCommands, "General Commands"); + // Add commands for each category + for (const [categoryName, commands] of Object.entries(categories)) { + addCommandFields(helpEmbed, commands, `${categoryName} Commands`); } - // Add mod-only commands in fields, if user is a mod - if (isMod && modCommands.length > 0) { - addCommandFields(helpEmbed, modCommands, "Mod-Only Commands"); - } - - // Send the single embed - await interaction.reply({ - embeds: [helpEmbed], - }); + await interaction.reply({ embeds: [helpEmbed] }); } catch (error) { console.error("Error executing the help command:", error); await interaction.reply({ diff --git a/commands/core/invite.js b/commands/core/invite.js index 5a92a93..baaf998 100644 --- a/commands/core/invite.js +++ b/commands/core/invite.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("invite") .setDescription("Provides an invite link to add the bot to your server."), + category: "Core", async execute(interaction, client) { try { diff --git a/commands/core/ping.js b/commands/core/ping.js index 61ca06d..8ba7bfa 100644 --- a/commands/core/ping.js +++ b/commands/core/ping.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("ping") .setDescription("Replies with Pong! and bot latency"), + category: "Core", async execute(interaction, client) { try { diff --git a/commands/core/uptime.js b/commands/core/uptime.js index 9d08fb0..6cf72a3 100644 --- a/commands/core/uptime.js +++ b/commands/core/uptime.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("uptime") .setDescription("Shows how long the bot has been running"), + category: "Core", async execute(interaction, client) { try { diff --git a/commands/economy/balance.js b/commands/economy/balance.js index 45ceb61..e107fb1 100644 --- a/commands/economy/balance.js +++ b/commands/economy/balance.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("balance") .setDescription("Check your balance."), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/daily.js b/commands/economy/daily.js index 1bf3ffa..b1afa5f 100644 --- a/commands/economy/daily.js +++ b/commands/economy/daily.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("daily") .setDescription("Claim your daily reward and start a streak!"), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/inventory.js b/commands/economy/inventory.js index a9ec5ff..7bc0dcf 100644 --- a/commands/economy/inventory.js +++ b/commands/economy/inventory.js @@ -6,6 +6,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("inventory") .setDescription("View your inventory with item rarity"), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/sell.js b/commands/economy/sell.js index 27276c6..f0422fc 100644 --- a/commands/economy/sell.js +++ b/commands/economy/sell.js @@ -12,6 +12,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("sell") .setDescription("Sell an item from your inventory."), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/shop.js b/commands/economy/shop.js index 007a644..7544dbf 100644 --- a/commands/economy/shop.js +++ b/commands/economy/shop.js @@ -13,6 +13,7 @@ module.exports = { .setDescription("The item you want to buy (use item name)") .setRequired(false) ), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/trade.js b/commands/economy/trade.js index 3426b07..b89e3f1 100644 --- a/commands/economy/trade.js +++ b/commands/economy/trade.js @@ -31,6 +31,7 @@ module.exports = { .setDescription("Amount of coins to trade") .setRequired(false) ), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/economy/work.js b/commands/economy/work.js index ddea4da..0b54cc7 100644 --- a/commands/economy/work.js +++ b/commands/economy/work.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("work") .setDescription("Work to earn coins and experience random events!"), + category: "Economy", async execute(interaction) { const { user, guild } = interaction; diff --git a/commands/events/createEvent.js b/commands/events/createEvent.js index afb9c86..fe6f19c 100644 --- a/commands/events/createEvent.js +++ b/commands/events/createEvent.js @@ -60,6 +60,8 @@ module.exports = { { name: "Monthly", value: "monthly" } ) ), + category: "Events", + async execute(interaction) { const name = interaction.options.getString("name"); const description = interaction.options.getString("description"); diff --git a/commands/events/editEvent.js b/commands/events/editEvent.js index 6857881..2775e0b 100644 --- a/commands/events/editEvent.js +++ b/commands/events/editEvent.js @@ -55,6 +55,7 @@ module.exports = { { name: "Monthly", value: "monthly" } ) ), + category: "Events", async execute(interaction) { const name = interaction.options.getString("name"); diff --git a/commands/events/joinEvent.js b/commands/events/joinEvent.js index 306a70c..fbd75fc 100644 --- a/commands/events/joinEvent.js +++ b/commands/events/joinEvent.js @@ -13,6 +13,7 @@ module.exports = { .setDescription("Name of the event to join") .setRequired(true) ), + category: "Events", async execute(interaction) { const eventName = interaction.options.getString("event_name"); diff --git a/commands/events/leaveEvent.js b/commands/events/leaveEvent.js index 73e4031..43e71c6 100644 --- a/commands/events/leaveEvent.js +++ b/commands/events/leaveEvent.js @@ -12,6 +12,7 @@ module.exports = { .setDescription("Name of the event to leave") .setRequired(true) ), + category: "Events", async execute(interaction) { const eventName = interaction.options.getString("event_name"); diff --git a/commands/events/listEvents.js b/commands/events/listEvents.js index 3e2be9d..4bfd619 100644 --- a/commands/events/listEvents.js +++ b/commands/events/listEvents.js @@ -6,6 +6,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("listevents") .setDescription("List all upcoming events."), + category: "Events", async execute(interaction) { const { user } = interaction; diff --git a/commands/fun/bored.js b/commands/fun/bored.js index 840d8e4..98d5486 100644 --- a/commands/fun/bored.js +++ b/commands/fun/bored.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("bored") .setDescription("Get a random activity to do."), + category: "Fun", async execute(interaction) { try { diff --git a/commands/fun/purr.js b/commands/fun/purr.js index 2f0dd98..bd60ec4 100644 --- a/commands/fun/purr.js +++ b/commands/fun/purr.js @@ -49,6 +49,7 @@ module.exports = { ) .setRequired(false) ), + category: "Fun", async execute(interaction) { const category = interaction.options.getString("category"); diff --git a/commands/fun/randomfact.js b/commands/fun/randomfact.js index 14c4d1e..422c993 100644 --- a/commands/fun/randomfact.js +++ b/commands/fun/randomfact.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("randomfact") .setDescription("Get a random fun fact"), + category: "Fun", async execute(interaction) { try { diff --git a/commands/fun/uwu.js b/commands/fun/uwu.js index 03ae225..ce09a27 100644 --- a/commands/fun/uwu.js +++ b/commands/fun/uwu.js @@ -11,6 +11,8 @@ module.exports = { .setDescription("The text to uwufy") .setRequired(true) ), + category: "Fun", + async execute(interaction) { const inputText = interaction.options.getString("text"); diff --git a/commands/games/coin-flip.js b/commands/games/coin-flip.js index 4d16289..ddb8641 100644 --- a/commands/games/coin-flip.js +++ b/commands/games/coin-flip.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("coinflip") .setDescription("Flip a coin!"), + category: "Games", async execute(interaction) { const result = Math.random() < 0.5 ? "Heads" : "Tails"; diff --git a/commands/games/dice-roll.js b/commands/games/dice-roll.js index c161a1d..1ab34f6 100644 --- a/commands/games/dice-roll.js +++ b/commands/games/dice-roll.js @@ -12,6 +12,7 @@ module.exports = { .setMinValue(2) .setMaxValue(100) ), + category: "Games", async execute(interaction) { const sides = interaction.options.getInteger("sides") || 6; diff --git a/commands/games/rock-paper-scissors.js b/commands/games/rock-paper-scissors.js index 04b9c78..2710085 100644 --- a/commands/games/rock-paper-scissors.js +++ b/commands/games/rock-paper-scissors.js @@ -15,6 +15,7 @@ module.exports = { { name: "Scissors", value: "scissors" } ) ), + category: "Games", async execute(interaction) { const userChoice = interaction.options.getString("choice"); diff --git a/commands/games/scramble.js b/commands/games/scramble.js index b69188e..2c4ece3 100644 --- a/commands/games/scramble.js +++ b/commands/games/scramble.js @@ -102,6 +102,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("scramble") .setDescription("Play a word scramble game"), + category: "Games", async execute(interaction) { const userId = interaction.user.id; diff --git a/commands/games/spyfall.js b/commands/games/spyfall.js index c897821..4eaf7e5 100644 --- a/commands/games/spyfall.js +++ b/commands/games/spyfall.js @@ -13,6 +13,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("spyfall") .setDescription("Start a game of Spyfall."), + category: "Games", async execute(interaction) { const guildId = interaction.guild.id; diff --git a/commands/games/stopspyfall.js b/commands/games/stopspyfall.js index eeba7a8..b75d288 100644 --- a/commands/games/stopspyfall.js +++ b/commands/games/stopspyfall.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("stopspyfall") .setDescription("Stop the current Spyfall game in this server."), + category: "Games", async execute(interaction) { try { diff --git a/commands/games/trivia.js b/commands/games/trivia.js index 005d09f..e3761aa 100644 --- a/commands/games/trivia.js +++ b/commands/games/trivia.js @@ -293,6 +293,7 @@ module.exports = { })) ) ), + category: "Games", async execute(interaction, client) { const userId = interaction.user.id; diff --git a/commands/general/dictionary.js b/commands/general/dictionary.js index b1fa9cb..57ecee1 100644 --- a/commands/general/dictionary.js +++ b/commands/general/dictionary.js @@ -26,6 +26,8 @@ module.exports = { .setDescription("Whether the response should be ephemeral") .setRequired(false) ), + category: "General", + async execute(interaction) { const word = interaction.options.getString("word").toLowerCase(); const isEphemeral = interaction.options.getBoolean("ephemeral") || false; diff --git a/commands/general/thisDayInHistory.js b/commands/general/thisDayInHistory.js index 65a4f87..20109be 100644 --- a/commands/general/thisDayInHistory.js +++ b/commands/general/thisDayInHistory.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("thisdayinhistory") .setDescription("Shows historical events that happened on this day."), + category: "General", async execute(interaction) { try { diff --git a/commands/general/urbanDictionary.js b/commands/general/urbanDictionary.js index 4242513..6519a74 100644 --- a/commands/general/urbanDictionary.js +++ b/commands/general/urbanDictionary.js @@ -12,6 +12,8 @@ module.exports = { .setDescription("The term to look up") .setRequired(true) ), + category: "General", + async execute(interaction, client) { const term = interaction.options.getString("term").toLowerCase(); const guild = interaction.guild; diff --git a/commands/general/wordassociation.js b/commands/general/wordassociation.js index 15c27f2..34fdb5e 100644 --- a/commands/general/wordassociation.js +++ b/commands/general/wordassociation.js @@ -83,6 +83,7 @@ module.exports = { .setDescription("The word to find associations for") .setRequired(true) ), + category: "General", async execute(interaction) { const word = interaction.options.getString("word"); diff --git a/commands/information/botinfo.js b/commands/information/botinfo.js index 8a1562b..0b60380 100644 --- a/commands/information/botinfo.js +++ b/commands/information/botinfo.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("botinfo") .setDescription("Displays information about the bot"), + category: "Information", async execute(interaction, client) { try { diff --git a/commands/information/serverinfo.js b/commands/information/serverinfo.js index 091a579..9090003 100644 --- a/commands/information/serverinfo.js +++ b/commands/information/serverinfo.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("serverinfo") .setDescription("Displays information about the server"), + category: "Information", async execute(interaction) { try { diff --git a/commands/minecraft/whitelist.js b/commands/minecraft/whitelist.js index 5a4f17f..a43d300 100644 --- a/commands/minecraft/whitelist.js +++ b/commands/minecraft/whitelist.js @@ -12,6 +12,7 @@ module.exports = { .setRequired(true) ), isModOnly: true, + category: "Minecraft", async execute(interaction) { const username = interaction.options.getString("username"); diff --git a/commands/moderation/Servers.js b/commands/moderation/Servers.js index 560cce9..84f94b0 100644 --- a/commands/moderation/Servers.js +++ b/commands/moderation/Servers.js @@ -9,6 +9,7 @@ module.exports = { .setName("servers") .setDescription("Displays a list of servers the bot is currently in"), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/moderation/actionItems.js b/commands/moderation/actionItems.js index e83aaa1..aa7b392 100644 --- a/commands/moderation/actionItems.js +++ b/commands/moderation/actionItems.js @@ -15,6 +15,7 @@ module.exports = { ) .setRequired(true) ), + category: "Moderation", async execute(interaction) { const serverSettings = await ServerSettings.findOne({ diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 218ed3d..383a178 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -19,6 +19,7 @@ module.exports = { .setRequired(true) ), isModOnly: true, + category: "Moderation", async execute(interaction) { let replySent = false; diff --git a/commands/moderation/clearLeaderboard.js b/commands/moderation/clearLeaderboard.js index b38fb64..cfb3d5e 100644 --- a/commands/moderation/clearLeaderboard.js +++ b/commands/moderation/clearLeaderboard.js @@ -6,6 +6,7 @@ module.exports = { .setName("clearleaderboard") .setDescription("Clears all entries in the trivia leaderboard"), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 128e817..a3dd1ed 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -22,6 +22,7 @@ module.exports = { .setRequired(true) ), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/moderation/purge.js b/commands/moderation/purge.js index 6a547f1..71ccd7b 100644 --- a/commands/moderation/purge.js +++ b/commands/moderation/purge.js @@ -27,6 +27,7 @@ module.exports = { .setMaxValue(100) ), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/moderation/serverSettings.js b/commands/moderation/serverSettings.js index 56d428a..7e0ad80 100644 --- a/commands/moderation/serverSettings.js +++ b/commands/moderation/serverSettings.js @@ -11,6 +11,7 @@ module.exports = { .setDescription("Displays the current server settings"), isModOnly: true, + category: "Moderation", async execute(interaction) { let replySent = false; diff --git a/commands/moderation/setup.js b/commands/moderation/setup.js index aeaa10b..8ee3ceb 100644 --- a/commands/moderation/setup.js +++ b/commands/moderation/setup.js @@ -51,6 +51,7 @@ module.exports = { ) .setRequired(false) ), + category: "Moderation", async execute(interaction) { // Check if the user has admin permissions diff --git a/commands/moderation/timeout.js b/commands/moderation/timeout.js index 000465c..0149e3d 100644 --- a/commands/moderation/timeout.js +++ b/commands/moderation/timeout.js @@ -28,6 +28,7 @@ module.exports = { .setRequired(true) ), isModOnly: true, + category: "Moderation", async execute(interaction) { let replySent = false; diff --git a/commands/moderation/userinfo.js b/commands/moderation/userinfo.js index 4e62681..04df06f 100644 --- a/commands/moderation/userinfo.js +++ b/commands/moderation/userinfo.js @@ -15,6 +15,7 @@ module.exports = { .setRequired(false) ), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 63b9140..37444c2 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -22,6 +22,7 @@ module.exports = { .setRequired(true) ), isModOnly: true, + category: "Moderation", async execute(interaction) { try { diff --git a/commands/music/loop.js b/commands/music/loop.js new file mode 100644 index 0000000..a95db46 --- /dev/null +++ b/commands/music/loop.js @@ -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." + ); + } + }, +}; diff --git a/commands/music/lyrics.js b/commands/music/lyrics.js index 098565a..25269b9 100644 --- a/commands/music/lyrics.js +++ b/commands/music/lyrics.js @@ -13,6 +13,8 @@ module.exports = { .setDescription("Song name to search lyrics for (optional)") .setRequired(false) ), + category: "Music", + async execute(interaction, client) { await interaction.deferReply(); diff --git a/commands/music/nowplaying.js b/commands/music/nowplaying.js index 8720165..1dbd658 100644 --- a/commands/music/nowplaying.js +++ b/commands/music/nowplaying.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("nowplaying") .setDescription("Shows information about the current song"), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); diff --git a/commands/music/pause.js b/commands/music/pause.js index d6a1205..799e1b9 100644 --- a/commands/music/pause.js +++ b/commands/music/pause.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("pause") .setDescription("Pauses the current song"), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); diff --git a/commands/music/play.js b/commands/music/play.js index 7ea7c4b..c9c2dda 100644 --- a/commands/music/play.js +++ b/commands/music/play.js @@ -10,6 +10,8 @@ module.exports = { .setDescription("Song name or URL") .setRequired(true) ), + category: "Music", + async execute(interaction, client) { await interaction.deferReply(); const query = interaction.options.getString("query"); diff --git a/commands/music/queue.js b/commands/music/queue.js index 2573f3b..f588fd0 100644 --- a/commands/music/queue.js +++ b/commands/music/queue.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("queue") .setDescription("Shows the current music queue."), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); if (!queue || queue.songs.length === 0) { diff --git a/commands/music/resume.js b/commands/music/resume.js index 812d552..3c3f542 100644 --- a/commands/music/resume.js +++ b/commands/music/resume.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("resume") .setDescription("Resumes the paused song"), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); diff --git a/commands/music/shuffle.js b/commands/music/shuffle.js index 01832d8..9d6cfd8 100644 --- a/commands/music/shuffle.js +++ b/commands/music/shuffle.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("shuffle") .setDescription("Shuffles the current queue"), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); diff --git a/commands/music/skip.js b/commands/music/skip.js index 4a60cc6..e00c7f6 100644 --- a/commands/music/skip.js +++ b/commands/music/skip.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("skip") .setDescription("Skips the current song."), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); if (!queue) return interaction.reply("❌ No songs in queue!"); diff --git a/commands/music/stop.js b/commands/music/stop.js index 1a6522b..eb4c634 100644 --- a/commands/music/stop.js +++ b/commands/music/stop.js @@ -4,6 +4,8 @@ module.exports = { data: new SlashCommandBuilder() .setName("stop") .setDescription("Stops the music and clears the queue."), + category: "Music", + async execute(interaction, client) { const queue = client.distube.getQueue(interaction.guildId); if (!queue) return interaction.reply("❌ No music is playing!"); diff --git a/commands/music/volume.js b/commands/music/volume.js index 50e9681..9f9d43e 100644 --- a/commands/music/volume.js +++ b/commands/music/volume.js @@ -12,6 +12,8 @@ module.exports = { .setMinValue(1) .setMaxValue(100) ), + category: "Music", + async execute(interaction, client) { const volume = interaction.options.getInteger("level"); const queue = client.distube.getQueue(interaction.guildId); diff --git a/commands/stats/cs2.js b/commands/stats/cs2.js index e69ec94..5796ff8 100644 --- a/commands/stats/cs2.js +++ b/commands/stats/cs2.js @@ -11,6 +11,7 @@ module.exports = { .setDescription("The Steam ID to fetch stats for.") .setRequired(true) ), + category: "Stats", async execute(interaction) { const steamId = interaction.options.getString("steam_id"); diff --git a/commands/stats/tft.js b/commands/stats/tft.js index 9d440f3..e8f41a2 100644 --- a/commands/stats/tft.js +++ b/commands/stats/tft.js @@ -13,6 +13,7 @@ module.exports = { ) .setRequired(true) ), + category: "Stats", async execute(interaction) { const username = interaction.options.getString("username"); diff --git a/commands/stats/valorant.js b/commands/stats/valorant.js index a4a4d31..264b045 100644 --- a/commands/stats/valorant.js +++ b/commands/stats/valorant.js @@ -41,6 +41,8 @@ module.exports = { .setDescription("Include roles stats?") .setRequired(false) ), + category: "Stats", + async execute(interaction) { // Immediately defer the reply await interaction.deferReply(); diff --git a/commands/utils/leaderboard.js b/commands/utils/leaderboard.js index 0932a15..ba1ea7c 100644 --- a/commands/utils/leaderboard.js +++ b/commands/utils/leaderboard.js @@ -5,6 +5,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("leaderboard") .setDescription("Displays the trivia leaderboard"), + category: "Utils", async execute(interaction, client) { const guild = interaction.guild; diff --git a/commands/utils/stats.js b/commands/utils/stats.js index 30c47f7..94b1e54 100644 --- a/commands/utils/stats.js +++ b/commands/utils/stats.js @@ -4,6 +4,7 @@ module.exports = { data: new SlashCommandBuilder() .setName("stats") .setDescription("Displays server statistics."), + category: "Utils", async execute(interaction) { try { diff --git a/commands/verification/code.js b/commands/verification/code.js index 339fe70..4afae7e 100644 --- a/commands/verification/code.js +++ b/commands/verification/code.js @@ -12,6 +12,7 @@ module.exports = { .setDescription("Your verification code") .setRequired(true) ), + category: "Verification", async execute(interaction, client) { // Fetch server settings from the database diff --git a/commands/verification/verify.js b/commands/verification/verify.js index 74947f4..299acc9 100644 --- a/commands/verification/verify.js +++ b/commands/verification/verify.js @@ -21,6 +21,7 @@ module.exports = { .setDescription("Your DCU email address") .setRequired(true) ), + category: "Verification", async execute(interaction, client) { // Fetch the server settings from the database using guild ID diff --git a/index.js b/index.js index 1ea18dc..6202a23 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ client.distube `✅ Added: **${song.name}** - \`${song.formattedDuration}\`` ); }) - .on("error", (channel, error) => { + .on("error", (queue, error) => { console.error("DisTube error:", error); queue.textChannel.send("❌ An error occurred: " + error.message); })