diff --git a/commands/dev/reload.js b/commands/dev/reload.js index 17bd12a..9b949d9 100644 --- a/commands/dev/reload.js +++ b/commands/dev/reload.js @@ -29,8 +29,12 @@ module.exports = { const command = commands.find(c => c.data.name === cmdName); - if(!command?.meta.canReload) { - interaction.reply({ content: `You can't reload the \`${command.data.name}\` command.`, ephemeral: true }); + if(command?.properties.folder == 'dev') { + interaction.reply({ content: `You can't reload \`${cmdName}\` because it is a development command.`, ephemeral: true }); + return; + } + else if(!command) { + interaction.reply({ content: `Command \`${cmdName}\` wasn't found.`, ephemeral: true }); return; } @@ -65,6 +69,8 @@ module.exports = { await clientCommand.permissions.set({ id: clientCommand.id, permissions: newCommand.permissions }); + interaction.reply({ content: `Command \`${cmdName}\` reloaded successfully.`, ephemeral: true }); + console.log( 'Old Command --------------------------------\n', oldCommand, '\nData:\n', oldCommandData, diff --git a/events/interactions/interactionCreate.js b/events/interactions/interactionCreate.js index 32a76b9..24bee4f 100644 --- a/events/interactions/interactionCreate.js +++ b/events/interactions/interactionCreate.js @@ -4,6 +4,9 @@ module.exports = { name: 'interactionCreate', async execute(interaction, client) { + console.log('NEW INTERACTION ################################'); + console.time('Interaction time'); + if(interaction.isCommand()) { console.log(`\nCommand ${interaction.commandName} executing ----------------\n`); @@ -31,5 +34,8 @@ module.exports = { } + console.timeEnd('Interaction time'); + console.log('################################################\n'); + }, }; \ No newline at end of file diff --git a/index.js b/index.js index 1d4cc1f..5a86e3f 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,10 @@ for (const folder of commandFolders) { for (const file of commandFiles) { const command = require(`./commands/${folder}/${file}`); + + if(command.properties) command.proprieties.folder = folder; + else command.properties = { folder: folder }; + commands.push(command); commandsData.push(command.data.toJSON());